<?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.tofly.watermeter.mapper.BwsbzjdatailMapper">

    <resultMap id="bwsbzjdatailMap" type="com.tofly.watermeter.entity.Bwsbzjdatail">
        <!--        <id property="id" column="ID"/>-->
        <result property="bwLsbh" column="BW_LSBH"/>
        <result property="bwKhbh" column="BW_KHBH"/>
        <result property="bwKhxm" column="BW_KHXM"/>
        <result property="bwKhdz" column="BW_KHDZ"/>
        <result property="bwKhdh" column="BW_KHDH"/>
        <result property="bwGspq" column="BW_GSPQ"/>
        <result property="bwZjyf" column="BW_ZJYF"/>
        <result property="bwSbbh" column="BW_SBBH"/>
        <result property="bwSbcj" column="BW_SBCJ"/>
        <result property="bwSblx" column="BW_SBLX"/>
        <result property="bwSbkj" column="BW_SBKJ"/>
        <result property="bwYsxz" column="BW_YSXZ"/>
        <result property="bwScrq" column="BW_SCRQ"/>
        <result property="bwAzrq" column="BW_AZRQ"/>
        <result property="bwBz" column="BW_BZ"/>
        <result property="scScrq" column="SC_SCRQ"/>

    </resultMap>

    <select id="getYearMonth" resultType="map">
        SELECT BW_ZJYF AS zjyf
        FROM TF_YWPN_BWSBZJDATAIL_W
        GROUP BY BW_ZJYF
    </select>

<!--    <select id="getCjByCode" resultType="string">-->
<!--        SELECT CNAME FROM TF_YWPN_SYSCHILDCODE_D WHERE PCID = 2 AND CCODE = #{sbcj}-->
<!--    </select>-->
<!--    <select id="getKjByCode" resultType="string">-->
<!--        SELECT CNAME FROM TF_YWPN_SYSCHILDCODE_D WHERE PCID = 1 AND CCODE = #{sbkj}-->
<!--    </select>-->
<!--    <select id="getLxByCode" resultType="string">-->
<!--        SELECT CNAME FROM TF_YWPN_SYSCHILDCODE_D WHERE PCID = 3 AND CCODE = #{sblx}-->
<!--    </select>-->

    <update id="updateZjKh">
        <foreach collection="list" open="begin" close=";end;" item="kh" separator=";">
            UPDATE TF_YWPN_QFKHJBXX_W
            set XC_ZJRQ = #{kh.xcZjrq}
            WHERE YHBH = #{kh.yhbh}
        </foreach>
    </update>

</mapper>
