<?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.khsdtyb.mapper.KhsdtybMapper">

    <!-- 通用查询映射结果 -->
    <resultMap id="khsdtybResultMap" type="org.springblade.modules.khsdtyb.entity.KhsdtybEntity">
        <result column="id" property="id"/>
        <result column="gzlxdl" property="gzlxdl"/>
        <result column="gzlxxl" property="gzlxxl"/>
        <result column="pfx" property="pfx"/>
        <result column="khgz" property="khgz"/>
        <result column="khfs" property="khfs"/>
        <result column="sjhm" property="sjhm"/>
        <result column="fz" property="fz"/>
        <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="selectKhsdtybPage" resultMap="khsdtybResultMap">
        select tyb.*,b.khcs khtimes,b.khyf khmonth
        from jlrh_khsdtyb tyb
        left join jlrh_khsd_pcs b on b.khxid =  tyb.id
        where tyb.is_deleted = 0 and (tyb.create_user = '1123598821738675201' or tyb.create_user = #{khsdtyb.createUser})
    </select>


    <select id="exportKhsdtyb" resultType="org.springblade.modules.khsdtyb.excel.KhsdtybExcel">
        SELECT * FROM jlrh_khsdtyb ${ew.customSqlSegment}
    </select>

</mapper>
