<?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.business.kcgl.mapper.DataKcglKcbdDefaultMapper">

    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.unis.crk.business.kcgl.entity.DataKcglKcbdDefault">
        <id column="DataID" property="DataID" />
        <result column="UnitID" property="UnitID" />
        <result column="PeriodID" property="PeriodID" />
        <result column="RoundID" property="RoundID" />
        <result column="builder" property="builder" />
        <result column="UPDATE_TIME" property="updateTime" />
        <result column="BuildDate" property="BuildDate" />
        <result column="editor" property="editor" />
        <result column="ModifyDate" property="ModifyDate" />
        <result column="DeptID" property="DeptID" />
        <result column="SytelInfoID" property="SytelInfoID" />
        <result column="cfid" property="cfid" />
        <result column="hwid" property="hwid" />
        <result column="yrcfid" property="yrcfid" />
        <result column="yrhwid" property="yrhwid" />
        <result column="pz" property="pz" />
        <result column="bdsl" property="bdsl" />
        <result column="xz" property="xz" />
        <result column="ywfssj" property="ywfssj" />
        <result column="bdfs" property="bdfs" />
        <result column="bgy" property="bgy" />
        <result column="bddh" property="bddh" />
        <result column="scrq" property="scrq" />
        <result column="dj" property="dj" />
        <result column="ccdd" property="ccdd" />
        <result column="cfqs" property="cfqs" />
        <result column="cx" property="cx" />
        <result column="ccnl" property="ccnl" />
        <result column="ccdmc" property="ccdmc" />
        <result column="ywjssj" property="ywjssj" />
        <result column="mxpz" property="mxpz" />
        <result column="lkbm" property="lkbm" />
        <result column="jgmc" property="jgmc" />
        <result column="bdpczsl" property="bdpczsl" />
        <result column="bdpczzl" property="bdpczzl" />
        <result column="jgkmc" property="jgkmc" />
        <result column="bdhxz" property="bdhxz" />
        <result column="cfmc" property="cfmc" />
        <result column="hwmc" property="hwmc" />
        <result column="czy" property="czy" />
        <result column="yrcfmc" property="yrcfmc" />
        <result column="yrhwmc" property="yrhwmc" />
        <result column="qcsl" property="qcsl" />
        <result column="jysl" property="jysl" />
        <result column="yrcqcsl" property="yrcqcsl" />
        <result column="yrcjysl" property="yrcjysl" />
        <result column="cph" property="cph" />
        <result column="cyr" property="cyr" />
        <result column="sjh" property="sjh" />
        <result column="fhr" property="fhr" />
        <result column="fhrsjh" property="fhrsjh" />
        <result column="yrcfbgy" property="yrcfbgy" />
        <result column="rksf" property="rksf" />
        <result column="rkzz" property="rkzz" />
        <result column="cksf" property="cksf" />
        <result column="ckzz" property="ckzz" />
        <result column="syyy" property="syyy" />
        <result column="ccshr" property="ccshr" />
        <result column="zjshr" property="zjshr" />
        <result column="tjshr" property="tjshr" />
        <result column="kjshr" property="kjshr" />
        <result column="ldshr" property="ldshr" />
        <result column="rksl" property="rksl" />
        <result column="cksl" property="cksl" />
        <result column="sjsh" property="sjsh" />
        <result column="sfjl" property="sfjl" />
        <result column="bgfs" property="bgfs" />
        <result column="cd" property="cd" />
        <result column="hzzrsh" property="hzzrsh" />
        <result column="shsxsl" property="shsxsl" />
        <result column="ch" property="ch" />
        <result column="ccnx" property="ccnx" />
        <result column="bgzrdesh" property="bgzrdesh" />
        <result column="zrbgy" property="zrbgy" />
        <result column="bmsh" property="bmsh" />
        <result column="tjsh" property="tjsh" />
        <result column="dwfzrsh" property="dwfzrsh" />
        <result column="sybl" property="sybl" />
        <result column="jyxmc" property="jyxmc" />
        <result column="jyz" property="jyz" />
        <result column="jykl" property="jykl" />
        <result column="jykj" property="jykj" />
        <result column="pczl" property="pczl" />
        <result column="pch" property="pch" />
        <result column="bhyy" property="bhyy" />
        <result column="klzt" property="klzt" />
        <result column="sysfzc" property="sysfzc" />
        <result column="jzsysl" property="jzsysl" />
        <result column="qzchwqsh" property="qzchwqsh" />
        <result column="qzszkl" property="qzszkl" />
        <result column="qzzrshde" property="qzzrshde" />
        <result column="chsl" property="chsl" />
    </resultMap>

    <select id="selectMyMapsPage" resultType="java.util.Map">
        SELECT DISTINCT
        DATA_KCGL_KCBD_DEFAULT.ModifyDate AS "ModifyDate",
        DATA_KCGL_KCBD_DEFAULT.bgy AS "bgy",
        DATA_KCGL_KCBD_DEFAULT.hwmc AS "hwmc",
        DATA_KCGL_KCBD_DEFAULT.cfmc AS "cfmc",
        DATA_KCGL_KCBD_DEFAULT.xz AS "xz",
        b_3.enumName AS "xz_value",
        DATA_KCGL_KCBD_DEFAULT.bdfs AS "bdfs",
        b_4.enumName AS "bdfs_value",
        DATA_KCGL_KCBD_DEFAULT.pz AS "pz",
        b_5.enumName AS "pz_value",
        DATA_KCGL_KCBD_DEFAULT.ywfssj AS "ywfssj",
        DATA_KCGL_KCBD_DEFAULT.dj AS "dj",
        b_7.enumName AS "dj_value",
        DATA_KCGL_KCBD_DEFAULT.bddh AS "bddh",
        DATA_KCGL_KCBD_DEFAULT.bdsl AS "bdsl",
        DATA_KCGL_KCBD_DEFAULT.DataID AS DataID
        FROM
        DATA_KCGL_KCBD_DEFAULT
        LEFT JOIN basic_enum b_3 ON DATA_KCGL_KCBD_DEFAULT.xz = b_3.enumId
        LEFT JOIN basic_enum b_4 ON DATA_KCGL_KCBD_DEFAULT.bdfs = b_4.enumId
        LEFT JOIN basic_enum b_5 ON DATA_KCGL_KCBD_DEFAULT.pz = b_5.enumId
        LEFT JOIN basic_enum b_7 ON DATA_KCGL_KCBD_DEFAULT.dj = b_7.enumId
        AND 1 = 1
        WHERE
        1 = 1
        AND ifnull(
        DATA_KCGL_KCBD_DEFAULT.SytelInfoID,
        ''
        ) = '2c9180847060449e017061e8d03203fe'
        AND DATA_KCGL_KCBD_DEFAULT.PeriodID = '12'
        AND DATA_KCGL_KCBD_DEFAULT.RoundId = 0
        <if test="ew.sqlSegment != null and ew.sqlSegment != ''">
            and  ${ew.sqlSegment}
        </if>
        ORDER BY
        DATA_KCGL_KCBD_DEFAULT.BuildDate DESC
    </select>
    <select id="getOneKCbd" resultType="java.util.Map">
        SELECT
        a.zjshr AS "zjshr",
        a.tjshr AS "tjshr",
        a.yrcjysl AS "yrcjysl",
        a.yrhwmc AS "yrhwmc",
        a.rkzz AS "rkzz",
        a.xz AS "xz",
        a.lkbm AS "lkbm",
        a.kjshr AS "kjshr",
        a.mxpz AS "mxpz",
        a.cfid AS "cfid",
        a.rksf AS "rksf",
        a.pz AS "pz",
        a.bgy AS "bgy",
        a.scrq AS "scrq",
        a.cfmc AS "cfmc",
        a.yrcfid AS "yrcfid",
        a.bdhxz AS "bdhxz",
        a.qcsl AS "qcsl",
        a.ywfssj AS "ywfssj",
        a.hwid AS "hwid",
        a.ywjssj AS "ywjssj",
        a.cksf AS "cksf",
        a.ckzz AS "ckzz",
        a.cd AS "cd",
        a.bdfs AS "bdfs",
        a.yrcfbgy AS "yrcfbgy",
        a.ldshr AS "ldshr",
        a.jgkmc AS "jgkmc",
        a.ccshr AS "ccshr",
        a.syyy AS "syyy",
        a.bddh AS "bddh",
        a.yrhwid AS "yrhwid",
        a.bdsl AS "bdsl",
        a.hwmc AS "hwmc",
        a.yrcqcsl AS "yrcqcsl",
        a.jysl AS "jysl",
        a.dj AS "dj",
        a.yrcfmc AS "yrcfmc",
        a.DataID AS "DataID",
        b_0.enumName AS "pz_value",
        b_1.enumName AS "bdhxz_value",
        b_2.enumName AS "xz_value",
        b_3.enumName AS "dj_value",
        b_4.enumName AS "scrq_value",
        b_5.enumName AS "bdfs_value"
        FROM
        DATA_KCGL_KCBD_DEFAULT a
        LEFT JOIN basic_enum b_0 ON a.pz = b_0.enumId
        LEFT JOIN basic_enum b_1 ON a.bdhxz = b_1.enumId
        LEFT JOIN basic_enum b_2 ON a.xz = b_2.enumId
        LEFT JOIN basic_enum b_3 ON a.dj = b_3.enumId
        LEFT JOIN basic_enum b_4 ON a.scrq = b_4.enumId
        LEFT JOIN basic_enum b_5 ON a.bdfs = b_5.enumId
        <where>
            <if test='id != null and id != ""'>
                a.DataID = #{id}
            </if>
        </where>
    </select>
</mapper>