<?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.nantian.cloud.jly.mapper.CheckPersonsMapper">

    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.nantian.cloud.jly.entity.CheckPersons">
        <id column="id" property="id" />
        <result column="check_plan_id" property="checkPlanId" />
        <result column="epc" property="epc" />
        <result column="num" property="num" />
        <result column="name" property="name" />
        <result column="dept" property="dept" />
        <result column="duties" property="duties" />
        <result column="major_dulties" property="majorDulties" />
        <result column="test_flag" property="testFlag" />
        <result column="cert_num" property="certNum" />
        <result column="cert_file" property="certFile" />
        <result column="comments" property="comments" />
        <result column="userid" property="userid" />
        <result column="update_time" property="updateTime" />
        <result column="del_flag" property="delFlag" />
        <result column="dept_id" property="deptId" />
    </resultMap>


    <select id="getPageScope" resultType="com.nantian.cloud.jly.entity.CheckPersons">
        select * from check_persons
        <trim prefix="where" prefixOverrides="and">
            <if test="query.checkPlanId != null">
                and check_plan_id = #{query.checkPlanId}
            </if>
            <if test="query.epc != null">
                and epc = #{query.epc}
            </if>
            <if test="query.num != null">
                and num = #{query.num}
            </if>
            <if test="query.name != null">
                and name = #{query.name}
            </if>
            <if test="query.dept != null">
                and dept = #{query.dept}
            </if>
            <if test="query.duties != null">
                and duties = #{query.duties}
            </if>
            <if test="query.testFlag != null">
                and test_flag = #{query.testFlag}
            </if>
            <if test="query.userid != null">
                and userid = #{query.userid}
            </if>
            <if test="query.delFlag != null">
                and del_flag = #{query.delFlag}
            </if>
            <if test="query.deptId != null">
                and dept_id = #{query.deptId}
            </if>
        </trim>
    </select>


</mapper>
