<?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.MmPredictInfluenceFactorDao">
|
<resultMap id="influenceFactor" type="com.iailab.module.model.mcs.pre.vo.MmPredictInfluenceFactorConfigVO">
|
<id property="id" column="id"/>
|
<result property="outputId" column="output_id"/>
|
<result property="outputName" column="output_name"/>
|
<result property="pattern" column="pattern"/>
|
<result property="isEnable" column="is_enable"/>
|
<result property="createTime" column="create_time"/>
|
<collection property="influenceFactors" ofType="com.iailab.module.model.mcs.pre.vo.MmPredictInfluenceFactorVO">
|
<id property="id" column="factors_id"/>
|
<result property="factorOutputId" column="factor_output_id"/>
|
<result property="factorOutputName" column="factor_output_name"/>
|
<result property="deviationValue" column="deviation_value"/>
|
</collection>
|
</resultMap>
|
<insert id="insertInfluenceFactor" parameterType="com.iailab.module.model.mcs.pre.vo.MmPredictInfluenceFactorVO">
|
INSERT INTO
|
t_mm_predict_influence_factor
|
(id,config_id,factor_output_id,deviation_value)
|
VALUES
|
<foreach collection="list" item="item" separator=",">
|
(#{item.id},#{item.configId},#{item.factorOutputId},#{item.deviationValue})
|
</foreach>
|
</insert>
|
|
<select id="getPage" resultMap="influenceFactor">
|
SELECT
|
t1.id,
|
t1.output_id,
|
t3.result_name output_name,
|
t1.pattern,
|
t1.is_enable,
|
t1.create_time,
|
t2.id factors_id,
|
t2.factor_output_id,
|
t4.result_name factor_output_name,
|
t2.deviation_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 t1.output_id = t3.id
|
LEFT JOIN t_mm_item_output t4 ON t2.factor_output_id = t4.id
|
<where>
|
<if test="params.outputName != null and params.outputName != ''">
|
and t3.result_name like CONCAT('%', #{params.outputName},'%')
|
</if>
|
<if test="params.pattern != null and params.pattern != ''">
|
and t1.pattern = #{params.pattern}
|
</if>
|
</where>
|
order by t1.create_time desc
|
</select>
|
<select id="getInfo" resultMap="influenceFactor" parameterType="java.lang.String">
|
SELECT
|
t1.id,
|
t1.output_id,
|
t3.result_name output_name,
|
t1.pattern,
|
t1.is_enable,
|
t1.create_time,
|
t2.id factors_id,
|
t2.factor_output_id,
|
t2.deviation_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 t1.output_id = t3.id
|
where t1.id = #{id}
|
</select>
|
<select id="selectList" resultType="com.iailab.module.model.mcs.pre.vo.MmPredictInfluenceFactorHandleVO" parameterType="map">
|
SELECT
|
t2.id,
|
t2.factor_output_id,
|
t2.deviation_value,
|
t1.pattern,
|
t3.pointid,
|
t4.predictlength,
|
t4.granularity
|
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_item t4 ON t3.itemid = t4.id
|
<where>
|
<if test="params.isEnable != null and params.isEnable != ''">
|
and t1.is_enable = #{params.isEnable}
|
</if>
|
<if test="params.pattern != null and params.pattern != ''">
|
and t1.pattern = #{params.pattern}
|
</if>
|
</where>
|
order by t1.create_time desc
|
</select>
|
</mapper>
|