<?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="org.springblade.modules.mdjfhf.mapper.HfMapper">

    <!-- 通用查询映射结果 -->
    <resultMap id="hfResultMap" type="org.springblade.modules.mdjfhf.entity.HfEntity">
        <result column="id" property="id"/>
        <result column="jf_id" property="jfId"/>
        <result column="hfdd" property="hfdd"/>
        <result column="hfdx" property="hfdx"/>
        <result column="hfqk" property="hfqk"/>
        <result column="sfmy" property="sfmy"/>
        <result column="mjqm" property="mjqm"/>
        <result column="bz" property="bz"/>
        <result column="cszt" property="cszt"/>
        <result column="create_user" property="createUser"/>
        <result column="create_dept" property="createDept"/>
        <result column="create_time" property="createTime"/>
        <result column="update_user" property="updateUser"/>
        <result column="update_time" property="updateTime"/>
        <result column="status" property="status"/>
        <result column="is_deleted" property="isDeleted"/>
    </resultMap>


    <select id="selectHfPage" resultMap="hfResultMap">
        select * from mdjf_hf where is_deleted = 0
    </select>


    <select id="exportHf" resultType="org.springblade.modules.mdjfhf.excel.HfExcel">
        SELECT * FROM mdjf_hf ${ew.customSqlSegment}
    </select>

    <select id="getCountHfcsByMdId" resultType="java.lang.Integer">
        select count(1) from mdjf_hf where is_deleted = 0 and jf_id = #{jfId}  and create_time &lt; #{jzsj}
    </select>
    <select id="getCountHfcsByMdIdBYTime2" resultType="java.lang.Integer">
        select count(1) from mdjf_hf where is_deleted = 0 and jf_id = #{jfId}  and create_time between #{hfjzsj} and #{hfjzsj2}
    </select>
    <select id="getCountHfcsByMdIdBYTime3" resultType="java.lang.Integer">
        select count(1) from mdjf_hf where is_deleted = 0 and jf_id = #{jfId}  and create_time between #{hfjzsj2} and #{hfjzsj3}
    </select>
    <select id="getCountHfcsByMdIdBYTime4" resultType="java.lang.Integer">
        select count(1) from mdjf_hf where is_deleted = 0 and jf_id = #{jfId}  and create_time &lt; #{hfjzsj3}
    </select>


    <select id="getCountsHfcsByMdId" resultType="org.springblade.modules.mdjfhf.entity.HfEntity">
        select id,jf_id,create_time from mdjf_hf where is_deleted = 0 and jf_id = #{jfId}  and create_time &lt; #{jzsj}
    </select>
</mapper>
