GIL
dengzedong
3 天以前 4fa2589807e4ab70680acaf5fe072e3944fddcf6
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?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.iailab.module.model.mcs.pre.dao.MmPredictInfluenceFactorResultDao">
 
    <insert id="insertOrUpdate" parameterType="com.iailab.module.model.mcs.pre.entity.MmPredictInfluenceFactorResultEntity">
        INSERT INTO t_mm_predict_influence_factor_result (factor_id, time, value)
        VALUES
        <foreach collection="list" item="item" separator=",">
            (#{item.factorId},#{item.time},#{item.value})
        </foreach>
        ON DUPLICATE KEY UPDATE
        value = VALUES(value);
    </insert>
    <select id="getResultList" resultType="com.iailab.module.model.mcs.pre.vo.MmPredictInfluenceFactorResultVO"
            parameterType="com.iailab.module.model.mcs.pre.vo.MmPredictInfluenceFactorResultListReqVO">
        SELECT
            t1.output_id,
            t1.pattern,
            t3.result_name factor_output_name,
            t4.time,
            t4.value
        FROM
            t_mm_predict_influence_factor_config t1
                LEFT JOIN t_mm_predict_influence_factor t2 ON t1.id = t2.config_id
                LEFT JOIN t_mm_item_output t3 ON t2.factor_output_id = t3.id
                LEFT JOIN t_mm_predict_influence_factor_result t4 ON t4.factor_id = t2.id
        WHERE
        t1.is_enable = 1
        and t1.output_id IN
        <foreach collection="outIds" item="item" open="(" close=")" separator=",">
            #{item}
        </foreach>
        <if test="startTime != null">
            AND t4.time &gt;= #{startTime}
        </if>
        <if test="endTime != null">
            AND t4.time &lt;= #{endTime}
        </if>
    </select>
</mapper>