123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144 |
- <?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.windexceptioncount.WindExceptionCountMapper">
- <resultMap id="resultMap" type="com.energy.manage.common.po.windexceptioncount.WindExceptionCountPo">
- <id column="id" property="id" jdbcType="BIGINT"/>
- <result column="batch_code" property="batchCode" jdbcType="VARCHAR"/>
- <result column="engine_code" property="engineCode" jdbcType="VARCHAR"/>
- <result column="analysis_type_code" property="analysisTypeCode" jdbcType="VARCHAR"/>
- <result column="err_count" property="errCount" jdbcType="INTEGER"/>
- <result column="handle_err_count" property="handleErrCount" jdbcType="INTEGER"/>
- <result column="create_by" property="createBy" jdbcType="INTEGER"/>
- <result column="create_time" property="createTime" jdbcType="TIMESTAMP"/>
- <result column="update_by" property="updateBy" jdbcType="INTEGER"/>
- <result column="update_time" property="updateTime" jdbcType="TIMESTAMP"/>
- </resultMap>
- <select id="selectByCondition" parameterType="com.energy.manage.service.domain.dto.windexceptioncount.WindExceptionCountDto" resultType="com.energy.manage.service.domain.vo.windexceptioncount.WindExceptionCountVo">
- select
- count.id,
- count.batch_code,
- count.engine_code,
- engine.engine_name,
- type.type_name as analysis_type_name,
- count.analysis_type_code,
- count.err_count,
- count.handle_err_count,
- count.create_by,
- count.create_time,
- count.update_by,
- count.update_time
- from
- wind_exception_count count
- left join analysis_type type
- on count.analysis_type_code = type.type_code
- left join wind_engine_group engine
- on engine.engine_code = count.engine_code
- where
- count.is_delete = 0
- and count.batch_code = #{batchCode}
- <if test="engineCode != null and engineCode != ''">
- and count.engine_code = #{engineCode}
- </if>
- <if test="analysisTypeCode != null and analysisTypeCode != ''">
- and count.analysis_type_code = #{analysisTypeCode}
- </if>
- </select>
- <select id="selectByfieldCodes" parameterType="java.lang.String" resultType="com.energy.manage.service.domain.vo.windexceptioncount.WindExceptionCountVo">
- select
- count.*,
- engine.engine_name,
- batch.field_code,
- batch.field_name
- from
- wind_exception_count count
- left join wind_field_batch batch
- on batch.batch_code = count.batch_code
- left join wind_engine_group engine
- on engine.engine_code = count.engine_code
- where
- batch.batch_code in (
- select distinct
- batch_code
- from
- wind_field_batch
- where
- field_code in
- <foreach collection="fieldCodes" open="(" separator="," close=")" item="fieldCode">
- #{fieldCode,jdbcType=VARCHAR}
- </foreach>
- );
- </select>
- <insert id="insertPoSelective" parameterType="com.energy.manage.service.domain.dto.windexceptioncount.WindExceptionCountDto">
- insert into wind_exception_count
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="batchCode != null">
- batch_code,
- </if>
- <if test="engineCode != null">
- engine_code,
- </if>
- <if test="analysisTypeCode != null">
- analysis_type_code,
- </if>
- <if test="errCount != null">
- err_count,
- </if>
- <if test="handleErrCount!= null">
- handle_err_count,
- </if>
- <if test="createBy != null">
- create_by,
- </if>
- <if test="updateBy != null">
- update_by
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="batchCode != null">
- #{batchCode,jdbcType=VARCHAR},
- </if>
- <if test="engineCode != null">
- #{engineCode,jdbcType=VARCHAR},
- </if>
- <if test="analysisTypeCode != null">
- #{analysisTypeCode,jdbcType=VARCHAR},
- </if>
- <if test="errCount != null">
- #{errCount,jdbcType=INTEGER},
- </if>
- <if test="handleErrCount != null">
- #{handleErrCount,jdbcType=INTEGER},
- </if>
- <if test="createBy != null">
- #{createBy,jdbcType=INTEGER},
- </if>
- <if test="updateBy != null">
- #{updateBy,jdbcType=INTEGER}
- </if>
- </trim>
- </insert>
- <update id="updatePoSelecttive" parameterType="com.energy.manage.service.domain.dto.windexceptioncount.WindExceptionCountDto">
- update wind_exception_count
- <set>
- <if test="errCount != null">
- err_count = #{errCount,jdbcType=INTEGER},
- </if>
- <if test="handleErrCount != null">
- handle_err_count = #{handleErrCount,jdbcType=INTEGER},
- </if>
- <if test="isDelete != null">
- is_delete = #{isDelete,jdbcType=INTEGER},
- </if>
- <if test="updateBy != null">
- update_by = #{updateBy,jdbcType=INTEGER}
- </if>
- </set>
- where id = #{id,jdbcType=BIGINT}
- </update>
- </mapper>
|