<?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.sundot.airport.ledger.mapper.ScorePushConfigMapper">

    <resultMap id="ScorePushConfigResult" type="com.sundot.airport.ledger.domain.ScorePushConfig">
        <id     property="id"             column="id"/>
        <result property="dimensionId"    column="dimension_id"/>
        <result property="dimensionName"  column="dimension_name"/>
        <result property="deptId"         column="dept_id"/>
        <result property="deptName"       column="dept_name"/>
        <result property="warnThreshold"  column="warn_threshold"/>
        <result property="pushUserIds"    column="push_user_ids"/>
        <result property="pushUserNames"  column="push_user_names"/>
        <result property="status"         column="status"/>
        <result property="remark"         column="remark"/>
        <result property="createBy"       column="create_by"/>
        <result property="createTime"     column="create_time"/>
        <result property="updateBy"       column="update_by"/>
        <result property="updateTime"     column="update_time"/>
    </resultMap>

    <sql id="selectVo">
        SELECT id, dimension_id, dimension_name, dept_id, dept_name,
               warn_threshold, push_user_ids, push_user_names, status, remark,
               create_by, create_time, update_by, update_time
        FROM score_push_config
    </sql>

    <select id="selectList" parameterType="com.sundot.airport.ledger.domain.ScorePushConfig"
            resultMap="ScorePushConfigResult">
        <include refid="selectVo"/>
        WHERE 1=1
        <if test="dimensionId != null">AND dimension_id = #{dimensionId}</if>
        <if test="deptId != null">AND dept_id = #{deptId}</if>
        <if test="status != null and status != ''">AND status = #{status}</if>
        ORDER BY dimension_id ASC, id ASC
    </select>

</mapper>
