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

    <resultMap id="qfcbsbglMap" type="com.tofly.watermeter.entity.Qfcbsbgl">
        <id property="id" column="ID"/>
        <result property="sbbh" column="SBBH"/>
        <result property="sbmc" column="SBMC"/>
        <result property="sbcj" column="SBCJ"/>
        <result property="sbxh" column="SBXH"/>
        <result property="state" column="STATE"/>
        <result property="cyry" column="CYRY"/>
        <result property="lqsj" column="LQSJ"/>
        <association property="stateName" column="STATE" select="getStateName"/>
        <association property="cyryName" column="CYRY"
                     select="com.tofly.baseapi.mapper.ToflyCodeCommonMapper.getUserName"></association>
    </resultMap>
<select id="getStateName" resultType="string">
    select decode(#{state},'0','未发放','1','已发放')
    from dual
</select>

</mapper>
