<?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.DataKcglCplkcbdDefaultMapper">

        <!-- 通用查询映射结果 -->
        <resultMap id="BaseResultMap" type="com.unis.crk.cplbusiness.entity.DataKcglCplkcbdDefault">
                    <id column="dataId" property="dataId" />
                    <result column="unitid" property="unitid" />
                    <result column="zdmc" property="zdmc" />
                    <result column="zdbm" property="zdbm" />
                    <result column="ch" property="ch" />
                    <result column="hwh" property="hwh" />
                    <result column="chmc" property="chmc" />
                    <result column="hwmc" property="hwmc" />
                    <result column="builder" property="builder" />
                    <result column="cjsj" property="cjsj" />
                    <result column="editor" property="editor" />
                    <result column="modifyDate" property="modifyDate" />
                    <result column="updateTime" property="updateTime" />
                    <result column="scrq" property="scrq" />
                    <result column="bzq" property="bzq" />
                    <result column="xz" property="xz" />
                    <result column="bdhxz" property="bdhxz" />
                    <result column="deptId" property="deptId" />
                    <result column="sjjlpzmc" property="sjjlpzmc" />
                    <result column="sjjlpzbh" property="sjjlpzbh" />
                    <result column="sjjlppmc" property="sjjlppmc" />
                    <result column="sjjlppbh" property="sjjlppbh" />
                    <result column="sjjldjbh" property="sjjldjbh" />
                    <result column="sjjldjmc" property="sjjldjmc" />
                    <result column="sjjlspmc" property="sjjlspmc" />
                    <result column="sjjlspmcbh" property="sjjlspmcbh" />
                    <result column="bddh" property="bddh" />
                    <result column="scpc" property="scpc" />
                    <result column="bdsl" property="bdsl" />
                    <result column="bdfs" property="bdfs" />
                    <result column="bgy" property="bgy" />
                    <result column="cd" property="cd" />
                    <result column="scnf" property="scnf" />
                    <result column="bdqsl" property="bdqsl" />
                    <result column="gg" property="gg" />
                     <result column="jldw" property="jldw" />
                    <result column="bdjs" property="bdjs" />
                    <result column="bdhsl" property="bdhsl" />
                    <result column="yrch" property="yrch" />
                    <result column="yrhwh" property="yrhwh" />
                    <result column="yrchmc" property="yrchmc" />
                    <result column="yrhwmc" property="yrhwmc" />
                    <result column="yrcfbgy" property="yrcfbgy" />
                    <result column="SytelInfoID" property="SytelInfoID" />
                    <result column="yrcqsl" property="yrcqsl" />
                    <result column="yrchsl" property="yrchsl" />
                    <result column="bdqjs" property="bdqjs" />
                    <result column="bdhjs" property="bdhjs" />
                    <result column="yrcqjs" property="yrcqjs" />
                    <result column="yrchjs" property="yrchjs" />
                    <result column="bdje" property="bdje" />
                    <result column="ywsj" property="ywsj" />
                    <result column="bz" property="bz" />
                    <result column="jldwmc" property="jldwmc" />
                    <result column="dj" property="dj" />
                    <result column="isstaging" property="isstaging" />

        </resultMap>

    <select id="selectMyMapsPage" resultType="java.util.Map">
        SELECT a.*,b.storehouse_name as chName,c.storehouse_name as yrcfName ,jldw_enum.enumName AS jldwmc FROM data_kcgl_cplkcbd_default a
        LEFT JOIN basic_storehouse b on a.ch = b.storehouse_id
        LEFT JOIN basic_storehouse c on a.yrch = c.storehouse_id
        LEFT JOIN basic_enum jldw_enum ON jldw_enum.enumId = a.jldw
        <if test="ew.sqlSegment != null and ew.sqlSegment != ''">
            where  ${ew.sqlSegment}
        </if>
        order by a.cjsj desc
    </select>
</mapper>
