<?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.WarnLogsMapper">
    <insert id="addWarnLog">
        INSERT  INTO warn_logs VALUES
           <foreach collection="list" item="warnLogs" index="index" separator=",">
                (#{warnLogs.id})
           </foreach>
    </insert>
    <select id="selectWarnLogsList" resultType="com.muyu.domain.resp.WarnLogsResp">
        SELECT
            *,
            warn_rule.rule_name
        FROM
            warn_logs
                LEFT JOIN warn_rule
                          ON warn_logs.warn_rule_id = warn_rule.id
    </select>
    <select id="selectWarnLogs" resultType="com.muyu.domain.resp.WarnLogsResp">
        SELECT
            *,
            warn_rule.rule_name
        FROM
            warn_logs
                LEFT JOIN warn_rule
                          ON warn_logs.warn_rule_id = warn_rule.id
        where warn_rule.id=#{id}
    </select>
</mapper>
