<?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.simuwang.base.mapper.EmailTemplateDataRuleMapper">
    <resultMap id="BaseResultMap" type="com.simuwang.base.pojo.dos.EmailTemplateDataRuleDO">
        <id column="id" property="id"/>
        <result column="template_id" property="templateId"/>
        <result column="field_name" property="fieldName"/>
        <result column="row" property="row"/>
        <result column="column" property="column"/>
        <result column="field_rule" property="fieldRule"/>
        <result column="isvalid" property="isvalid"/>
        <result column="creatorid" property="creatorId"/>
        <result column="createtime" property="createTime"/>
        <result column="updaterid" property="updaterId"/>
        <result column="updatetime" property="updateTime"/>
    </resultMap>

    <select id="queryByTemplateId" resultMap="BaseResultMap">
        select *
        from PPW_EMAIL.email_template_data_rule
        where isvalid = 1
        and template_id in
        <foreach collection="templateIdList" index="index" item="templateId" open="(" separator="," close=")">
            #{templateId}
        </foreach>
    </select>
</mapper>