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

    <!-- 通用查询映射结果 -->
<!--    <resultMap id="BaseResultMap" type="com.nantian.cloud.jly.entity.CheckAbnormalReport">-->
<!--        <id column="id" property="id" />-->
<!--        <result column="check_plan_id" property="checkPlanId" />-->
<!--        <result column="epc" property="epc" />-->
<!--        <result column="check_method" property="checkMethod" />-->
<!--        <result column="dept" property="dept" />-->
<!--        <result column="report_no" property="reportNo" />-->
<!--        <result column="abarbeitung" property="abarbeitung" />-->
<!--        <result column="check_item" property="checkItem" />-->
<!--        <result column="userid" property="userid" />-->
<!--        <result column="update_time" property="updateTime" />-->
<!--        <result column="del_flag" property="delFlag" />-->
<!--        <result column="dept_id" property="deptId" />-->
<!--    </resultMap>-->

<!--    <sql id="Base_Column_List">-->
<!--        id, check_plan_id, epc, check_method, dept, person, check_item, report_no, abarbeitung,-->
<!--        userid, update_time, del_flag, dept_id-->
<!--   </sql>-->

    <select id="getPageScope" resultType="com.nantian.cloud.jly.entity.CheckAbnormalReport">
        select *
        from check_abnormal_report
        <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.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>
            <if test="query.whetherIssued != null">
                and whether_issued = #{query.whetherIssued}
            </if>
        </trim>
    </select>
    <select id="getByEpc" resultType="com.nantian.cloud.jly.entity.CheckAbnormalReport">
        select *
        from check_abnormal_report
        <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.delFlag != null">
                and del_flag = #{query.delFlag}
            </if>
        </trim>
    </select>


</mapper>
