<?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.feesapi.dzht.mapper.HtFilesMapper">

    <resultMap id="htFilesMap" type="com.tofly.feesapi.dzht.entity.HtFiles">
        <id property="id" column="ID"/>
        <result property="wjlj" column="WJLJ"/>
        <result property="wjmc" column="WJMC"/>
        <result property="wjmcYs" column="WJMC_YS"/>
        <result property="wjdx" column="WJDX"/>
        <result property="wjxh" column="WJXH"/>
        <result property="wjfl" column="WJFL"/>
        <result property="czry" column="CZRY"/>
        <result property="czsj" column="CZSJ"/>
        <result property="zfbz" column="ZFBZ"/>
        <result property="zfyy" column="ZFYY"/>
        <result property="zfry" column="ZFRY"/>
        <result property="zfsj" column="ZFSJ"/>
        <result property="ssgs" column="SSGS"/>
        <result property="ywb" column="YWB"/>
        <result property="ywlx" column="YWLX"/>
        <result property="ywbh" column="YWBH"/>
        <result property="ywlcjd" column="YWLCJD"/>
        <result property="yhbh" column="YHBH"/>
        <result property="yhxm" column="YHXM"/>
        <result property="lxdh" column="LXDH"/>
        <result property="htHtlx" column="HT_HTLX"/>
        <result property="htHtbh" column="HT_HTBH"/>
        <result property="htQyr" column="HT_QYR"/>
        <result property="htQysj" column="HT_QYSJ"/>
        <result property="htHtmbid" column="HT_HTMBID"/>
        <result property="mid" column="MID"/>
    </resultMap>
    <select id="getHtReplaceParameter" resultType="com.tofly.feesapi.dzht.entity.vo.HtReplaceParameter">
        select a.yhbh,
               a.yhxm,
               a.zjhm,
               a.yhbh,
               a.email as dzyx,
               a.lxdh,
               b.sbbh,
               (select name from bm_yslx where code in (select yslx from bm_sj where code = b.sjbm)) ysxz,
               (select ccname from sys_child_code where pcid = '15' and CCCODE = b.bjwz)             sbazwz,
               (select ccname from sys_child_code where pcid = '12' and CCCODE = b.sbkj)             sbkj,
               (select ccname from sys_child_code where pcid = '13' and CCCODE = b.sblc)             sblc,
               '1' as                                                                                sbsl,
               (select name from bm_sblb where code = b.sblb)                                        sblx
        from yh_khjbxx a
                 left join yh_cbkxx b on a.yhbh = b.yhbh and b.cbkh = '1'
        where a.yhbh = #{yhbh}
    </select>

    <select id="getQfState" resultType="int">
        select count(*) from yy_qfmx where yhbh=#{yhbh} and sfbz=0
    </select>
</mapper>
