<?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.jljc.mapper.GovCriterionMapper">

    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.nantian.cloud.jljc.entity.GovCriterion">
        <id column="id" property="id" />
        <result column="criterion_name" property="criterionName" />
        <result column="criterion_type" property="criterionType" />
        <result column="file" property="file" />
        <result column="file_size" property="fileSize" />
        <result column="userid" property="userid"/>
        <result column="update_time" property="updateTime"/>
        <result column="del_flag" property="delFlag"/>
        <result column="dept_id" property="deptId"/>
        <result column="standard" property="standard"/>
        <result column="release_time" property="releaseTime"/>
        <result column="implementation_time" property="implementationTime"/>
    </resultMap>

    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        id, criterion_name, criterion_type, file, file_size, userid, update_time, del_flag,
        dept_id,standard,release_time,implementation_time
    </sql>

    <select id="getPageScope" resultType="com.nantian.cloud.jljc.entity.GovCriterion">
        select <include refid="Base_Column_List"></include>
        from gov_criterion
        <trim prefix="where" prefixOverrides="and">
            <if test="query.criterionName != null   and query.criterionName != ''">
                and criterion_name like concat("%",#{query.criterionName},"%")
            </if>
             <if test="query.criterionType != null   and query.criterionType != ''">
                and criterion_type like concat("%",#{query.criterionType},"%")
            </if>
            <if test="query.delFlag != null   and query.delFlag != ''">
                and del_flag = #{query.delFlag}
            </if>
        </trim>
        order by file desc
    </select>

</mapper>
