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

        <!-- 通用查询映射结果 -->
        <resultMap id="BaseResultMap" type="com.unis.crk.cplbusiness.entity.DataCrkywCpljyxxFlt001">
                    <id column="dataId" property="dataId" />
                    <result column="unitid" property="unitid" />
                    <result column="zdmc" property="zdmc" />
                    <result column="zdbm" property="zdbm" />
                    <result column="builder" property="builder" />
                    <result column="deptId" property="deptId" />
                    <result column="cjsj" property="cjsj" />
                    <result column="editor" property="editor" />
                    <result column="modifyDate" property="modifyDate" />
                    <result column="updateTime" property="updateTime" />
                    <result column="mainDataId" property="mainDataId" />
                    <result column="zbxmc" property="zbxmc" />
                    <result column="jykl" property="jykl" />
                    <result column="jykj" property="jykj" />
                    <result column="jyz" property="jyz" />
                    <result column="zbxmc_value" property="zbxmcValue" />
                    <result column="bz" property="bz" />
                     <result column="ddmid" property="ddmid" />
        </resultMap>

    <select id="selectMyMapsPage" resultType="java.util.Map">
        SELECT *   FROM  data_crkyw_cpljyxx_flt_001
        <if test="ew.sqlSegment != null and ew.sqlSegment != ''">
            where  ${ew.sqlSegment}
        </if>
    </select>
    <select id="getLitByMainDatId" resultType="java.util.Map">
        SELECT
        a.*,
        d.enumCode as "enumCode",
        d.enumName AS "zbxmc_value"
        FROM
        data_crkyw_cpljyxx_flt_001 a
        LEFT JOIN data_crkyw_cpljyxx_default b ON b.dataId = a.mainDataId
        LEFT JOIN basic_enum d ON a.zbxmc = d.enumId
        <where>
            <if test='mainDataId != null and mainDataId != ""'>
                and b.dataId = #{mainDataId}
            </if>
        </where>
        ORDER BY d.enumCode
    </select>
</mapper>