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

	<!-- 可根据自己的需求，是否要使用 -->
    <resultMap type="com.nantian.cloud.jly.entity.CheckLevelDegreeReport" id="checkLevelDegreeReportMap">
        <result property="id" column="id"/>
        <result property="type" column="type"/>
        <result property="purpose" column="purpose"/>
        <result property="checkPlanId" column="check_plan_id"/>
        <result property="epc" column="epc"/>
        <result property="num" column="num"/>
        <result property="userid" column="userid"/>
        <result property="updateTime" column="update_time"/>
        <result property="delFlag" column="del_flag"/>
        <result property="deptId" column="dept_id"/>
        <result property="inoutLevel" column="inout_level"/>
        <result property="inoutDegree" column="inout_degree"/>
        <result property="secondaryLevel" column="secondary_level"/>
        <result property="secondaryDegree" column="secondary_degree"/>
        <result property="mainLevel" column="main_level"/>
        <result property="mainDegree" column="main_degree"/>
        <result property="otherLevel" column="other_level"/>
        <result property="otherDegree" column="other_degree"/>
    </resultMap>


    <select id="getListPage" resultMap="checkLevelDegreeReportMap">
        SELECT
        *
        FROM
        check_level_degree_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>
            <if test="query.deptId != null">
                and dept_id = #{query.deptId}
            </if>
            <if test="query.userid != null">
                and userid = #{query.userid}
            </if>
        </trim>
        ORDER BY update_time DESC
    </select>

</mapper>