|
@@ -0,0 +1,87 @@
|
|
|
+<?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.energy.manage.service.mappers.autoanalysisconfigdetail.AutoAnalysisConfigDetailMapper">
|
|
|
+ <resultMap id="BaseResultMap" type="com.energy.manage.common.po.autoanalysisconfigdetail.AutoAnalysisConfigDetailPo">
|
|
|
+ <id column="id" jdbcType="BIGINT" property="id" />
|
|
|
+ <result column="field_code" jdbcType="VARCHAR" property="fieldCode" />
|
|
|
+ <result column="interval_days" jdbcType="INTEGER" property="intervalDays" />
|
|
|
+ <result column="start_time" jdbcType="TIMESTAMP" property="startTime" />
|
|
|
+ <result column="startup_state" jdbcType="INTEGER" property="startupState" />
|
|
|
+ <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
|
|
+ <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
|
|
|
+ </resultMap>
|
|
|
+ <sql id="Base_Column_List">
|
|
|
+ field_code, interval_days, start_time, startup_state, create_time, update_time
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="selectByCondition" parameterType="com.energy.manage.service.domain.dto.analysis.AutoAnalysisConfigDetailDto" resultType="com.energy.manage.service.domain.vo.analysis.AutoAnalysisConfigDetailVo">
|
|
|
+ select
|
|
|
+ detail.*,
|
|
|
+ field.field_name
|
|
|
+ from auto_analysis_config_detail detail
|
|
|
+ left join wind_field field
|
|
|
+ on detail.field_code = field.field_code
|
|
|
+ <where>
|
|
|
+ <if test="fieldCode != null and fieldCode != ''">
|
|
|
+ and detail.field_code = #{fieldCode}
|
|
|
+ </if>
|
|
|
+ <if test="fieldName != null and fieldName != ''">
|
|
|
+ and field.field_name like concat ('%', #{fieldName}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="startupState != null">
|
|
|
+ and detail.startup_state = #{startupState}
|
|
|
+ </if>
|
|
|
+ order by detail.update_time desc
|
|
|
+ </where>
|
|
|
+
|
|
|
+
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <insert id="insertConfig" parameterType="com.energy.manage.service.domain.dto.analysis.AutoAnalysisConfigDetailDto">
|
|
|
+ insert into auto_analysis_config_detail
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="fieldCode != null and fieldCode != ''">
|
|
|
+ field_code,
|
|
|
+ </if>
|
|
|
+ <if test="intervalDays != null">
|
|
|
+ interval_days,
|
|
|
+ </if>
|
|
|
+ <if test="startTime != null">
|
|
|
+ start_time,
|
|
|
+ </if>
|
|
|
+ <if test="startupState != null">
|
|
|
+ startup_state,
|
|
|
+ </if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="fieldCode != null and fieldCode != ''">
|
|
|
+ #{fieldCode,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="intervalDays != null">
|
|
|
+ #{intervalDays,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="startTime != null">
|
|
|
+ #{startTime,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="startupState != null">
|
|
|
+ #{startupState,jdbcType=BIT},
|
|
|
+ </if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <update id="updateConfigByCondition" parameterType="com.energy.manage.service.domain.dto.analysis.AutoAnalysisConfigDetailDto">
|
|
|
+ update auto_analysis_config_detail
|
|
|
+ <set>
|
|
|
+ <if test="intervalDays != null">
|
|
|
+ interval_days = #{intervalDays,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="startTime != null">
|
|
|
+ start_time = #{startTime,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="startupState != null">
|
|
|
+ startup_state = #{startupState,jdbcType=BIT},
|
|
|
+ </if>
|
|
|
+ </set>
|
|
|
+ where id = #{id,jdbcType=BIGINT}
|
|
|
+ </update>
|
|
|
+</mapper>
|