<?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.github.wxiaoqi.security.admin.mapper.AppraiseLabelInfoMapper">

	<!-- 可根据自己的需求，是否要使用 -->
    <resultMap type="com.github.wxiaoqi.security.admin.entity.AppraiseLabelInfo" id="appraiseLabelInfoMap">
        <result property="id" column="id"/>
        <result property="name" column="name"/>
        <result property="point" column="point"/>
        <result property="type" column="type"/>
        <result property="enable" column="enable"/>
        <result property="isDel" column="is_del"/>
        <result property="crtTime" column="crt_time"/>
        <result property="updTime" column="upd_time"/>
        <result property="rules" column="rules"/>
        <result property="sort" column="sort"/>
    </resultMap>

    <select id="selectList"  resultType="com.github.wxiaoqi.security.admin.entity.AppraiseLabelInfo" parameterType="com.github.wxiaoqi.security.admin.dto.AppraiseLabeInfoDTO">
        SELECT
       *
        FROM appraise_label_info a
        where a.is_del = 0
        <if test="name != null and  name != ''">
            AND ( a.`name` like concat('%',#{name},'%'))
        </if>
        <if test="type != null ">
            AND  a.`type`= #{type}
        </if>
        <if test="enable != null">
            AND a.enable = #{enable}
        </if>
        <if test="types != null and types.size() > 0">
            and a.type in
            <foreach collection="types"  item="item" separator="," open="(" close=")">
                #{item}
            </foreach>
        </if>
        order by a.upd_time DESC
    </select>
</mapper>