<?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.muyu.mapper.WarnRuleMapper">

    <select id="selectListByStrategyId" resultType="com.muyu.domain.resp.WarnRuleResp">
        SELECT * ,warn_strategy.strategy_name,
               message_template_type.message_field
        FROM `warn_rule`
                 LEFT JOIN warn_strategy ON warn_rule.strategy_id=warn_strategy.id
                 LEFT JOIN message_template_type ON warn_rule.msg_type_id=message_template_type.message_template_type_id
        WHERE warn_rule.strategy_id=#{strategyId}
    </select>
    <select id="selectWarnRuleRespList" resultType="com.muyu.domain.resp.WarnRuleResp">
        SELECT * ,warn_strategy.strategy_name,
               message_template_type.message_field
        FROM `warn_rule`
                 LEFT JOIN warn_strategy ON warn_rule.strategy_id=warn_strategy.id
                 LEFT JOIN message_template_type ON warn_rule.msg_type_id=message_template_type.message_template_type_id
    </select>
</mapper>
