<?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.roadm.admin.mapper.SmsAuditWordMapper">
    <resultMap id="auditWordTypeMap" type="cn.roadm.admin.table.SmsDataDictionaryTable">
        <id property="id" column="id"/>
        <result property="name" column="name"/>
        <result property="description" column="description"/>
        <result property="createTime" column="createtime"/>
        <result property="type" column="type"/>
        <result property="value" column="value"/>
        <result property="beginTime" column="beginTime"/>
        <result property="endTime" column="endTime"/>
        <result property="isTongYin" column="isTongyin"/>
    </resultMap>


    <select id="listQueryAuditWordType" resultMap="auditWordTypeMap">
        select c.name,
               c.id,
               c.description,
               c.createtime,
               c.type,
               c.value,
               beginTime,
               endTime,
               isTongyin
        from sms_data_dictionary c
        <where>
            <if test="type != null  and type != ''">
                and c.type = #{type}
            </if>
            <if test="status != null  and status != '-1'">
                and c.status = #{status}
            </if>
        </where>
        order by c.id desc
    </select>

    <select id="getAuditWordTypeOptions" resultType="cn.roadm.admin.entity.SpEditInfoSelectorEntity$Options">
        select id as `value`, name as label from sms_data_dictionary where status = 1
    </select>
</mapper>
