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

    <resultMap id="readupdateMap" type="com.tofly.watermeter.entity.Readupdate">
        <id property="id" column="ID"/>
        <result property="yhbh" column="YHBH"/>
        <result property="month" column="MONTH"/>
        <result property="newScds" column="NEW_SCDS"/>
        <result property="newBcds" column="NEW_BCDS"/>
        <result property="newCbsl" column="NEW_CBSL"/>
        <result property="oldScds" column="OLD_SCDS"/>
        <result property="oldBcds" column="OLD_BCDS"/>
        <result property="oldCbsl" column="OLD_CBSL"/>
        <result property="createDate" column="CREATE_DATE"/>
        <result property="createUser" column="CREATE_USER"/>
        <result property="yhxm" column="YHXM"/>
        <result property="yhdz" column="YHDZ"/>
        <result property="lxdh" column="LXDH"/>
        <result property="sourceType" column="SOURCE_TYPE"/>
        <result property="bgyy" column="BGYY"/>
        <result property="bgrq" column="BGRQ"/>
        <result property="updateBz" column="UPDATE_BZ"/>
        <result property="soleSign" column="SOLE_SIGN"/>
        <result property="isGeneral" column="IS_GENERAL"/>
        <result property="oldZgl" column="OLD_ZGL"/>
        <result property="oldDiffValue" column="OLD_DIFF_VALUE"/>
        <result property="oldZgl" column="NEW_ZGL"/>
        <result property="oldDiffValue" column="NEW_DIFF_VALUE"/>
        <association property="createUserName" column="CREATE_USER"
                     select="com.tofly.baseapi.mapper.ToflyCodeCommonMapper.getUserName"/>
    </resultMap>
    <select id="getReadUpdate" resultMap="readupdateMap">
        select * from TF_YWPN_READUPDATE_W where SOLE_SIGN = #{soleSign} and SOURCE_TYPE = '0' order by CREATE_DATE DESC
    </select>


</mapper>
