<?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.enterprise.mapper.WarnStrategyMapper">

    <select id="strategyList" resultType="com.muyu.enterprise.domain.resp.WarnStrategy">
        SELECT
            s.id AS strategy_id,
            s.msg_id,
            s.car_type_id,
            s.strategy_name,
            r.id AS rule_id,
            r.max_value,
            r.min_value,
            r.msg_type_id,
            r.rule_name,
            r.slide_frequency,
            r.slide_time,
            r.strategy_id,
            t_message_type.message_name
        FROM
            warn_strategy s
                LEFT JOIN warn_rule r ON s.id = r.strategy_id
                LEFT JOIN t_message_type on r.msg_type_id = t_message_type.message_type_id
    </select>
</mapper>
