<?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.axzo.msg.center.dal.mapper.MessageRelationMapper">

    <resultMap id="MessageRelationMap" type="cn.axzo.msg.center.domain.entity.MessageRelation">
        <result column="id" jdbcType="INTEGER" property="id"/>
        <result column="type_id" jdbcType="INTEGER" property="typeId"/>
        <result column="module_id" jdbcType="INTEGER" property="moduleId"/>
        <result column="template_id" jdbcType="INTEGER" property="templateId"/>
        <result column="template_code" jdbcType="VARCHAR" property="templateCode"/>
        <result column="is_delete" jdbcType="INTEGER" property="isDelete"/>
        <result column="create_at" jdbcType="TIMESTAMP" property="createAt"/>
        <result column="update_at" jdbcType="TIMESTAMP" property="updateAt"/>
    </resultMap>

    <!--查询模板信息 -->
    <select id="getTemplateByCode" resultType="cn.axzo.msg.center.domain.entity.MessageRelation">
        SELECT id,type_id,template_id,module_id,template_code,create_at,update_at from message_relation
        where is_delete=0 AND template_code=#{templateCode} AND module_id=#{moduleId}
    </select>


</mapper>

