<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.unis.crk.cplbusiness.mapper.OllectionReviewMapper">

        <!-- 通用查询映射结果 -->
        <resultMap id="BaseResultMap" type="com.unis.crk.cplbusiness.entity.OllectionReview">
                    <id column="dataId" property="dataId" />
                    <result column="unitid" property="unitid" />
                    <result column="builder" property="builder" />
                    <result column="builderDate" property="builderDate" />
                    <result column="editor" property="editor" />
                    <result column="modifyDate" property="modifyDate" />
                    <result column="updateTime" property="updateTime" />
                    <result column="collection_approval_no" property="collectionApprovalNo" />
                    <result column="receiving_goods" property="receivingGoods" />
                    <result column="picking_item_no" property="pickingItemNo" />
                    <result column="number" property="number" />
                    <result column="purpose" property="purpose" />
                    <result column="review_comments" property="reviewComments" />
                    <result column="collection_time" property="collectionTime" />
        </resultMap>

    <select id="getPerData" resultType="java.util.Map">
        SELECT *   FROM  ollection_review
        <if test="ew.sqlSegment != null and ew.sqlSegment != ''">
            where  ${ew.sqlSegment}
        </if>
    </select>
    <select id="selectMyMapsPage" resultType="java.util.Map">
        SELECT a.dataId,
               a.collection_approval_no,
               mxpz_enum.sjjlspmc AS  receiving_goods,
               a.number,
               a.collection_time
               FROM  ollection_review a
        LEFT JOIN data_crkyw_cplsp_default mxpz_enum ON mxpz_enum.sjjlspmcbh = a.picking_item_no
        and  mxpz_enum.unitId = a.unitId
        <if test="ew.sqlSegment != null and ew.sqlSegment != ''">
            where   ${ew.sqlSegment}
        </if>
        ORDER BY
        builderDate DESC
    </select>
</mapper>
