<?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="cn.com.countrygarden.bi.main.dao.ck.CkCleanerRecordingMapper">
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="cn.com.countrygarden.bi.main.model.ck.CkCleanerRecording">
        <id column="id" property="id"/>
        <result column="org_code" property="orgCode"/>
        <result column="org_name" property="orgName"/>
        <result column="comm_name" property="commName"/>
        <result column="comm_code" property="commCode"/>
        <result column="month" property="month"/>
        <result column="year" property="year"/>
        <result column="status" property="status"/>
        <result column="operating_by" property="operatingBy"/>
        <result column="operating_name" property="operatingName"/>
        <result column="operating_time" property="operatingTime"/>
        <result column="create_time" property="createTime"/>
        <result column="operating_type" property="operatingType"/>
        <result column="data_classification" property="dataClassification"/>
        <result column="basic_id" property="basicId"/>
    </resultMap>

    <select id="selectList" resultType="cn.com.countrygarden.bi.main.model.ck.CkCleanerRecording">
        SELECT id AS id,org_code AS orgCode,org_name AS orgName,comm_code AS commCode,comm_name AS commName,`month` AS `month`,`year` AS `year`,
        operating_type AS operatingType,data_classification AS dataClassification,
        operating_by AS operatingBy,operating_name AS operatingName,operating_time AS operatingTime,create_time AS createTime,basic_id as basicId
        FROM ck_cleaner_recording
        WHERE `status`=1
        <if test="orgCode!=null and orgCode!=''">
            and org_code=#{orgCode}
        </if>
        <if test="commCode!=null and commCode!=''">
            and comm_code=#{commCode}
        </if>
        <if test="month!=null and month!=''">
            and `month`=#{month}
        </if>
        <if test="year!=null and year!=''">
            and `year`=#{year}
        </if>
        <if test="operatingType!=null and operatingType!=''">
            and operating_type=#{operatingType}
        </if>
        <if test="dataClassification!=null and dataClassification!=''">
            and data_classification=#{dataClassification}
        </if>
        order by create_time desc
    </select>

</mapper>