123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216 |
- <?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.platform.dao.mapper.remote.RemoteOpcMapper">
- <sql id="Base_Column_List">
- opc.id,
- opc.sb_id,
- opc.sb_name,
- opc.position_num,
- opc.line,
- opc.type,
- opc.warn_first,
- opc.warn_second,
- opc.warn_third,
- opc.warn_four,
- opc.warn_first_color,
- opc.warn_second_color,
- opc.warn_third_color,
- opc.warn_four_color,
- opc.low,
- opc.high,
- opc.description,
- opc.result,
- opc.av_flag,
- opc.port_flag,
- opc.fetch_flag,
- opc.created_flag,
- opc.position_flag,
- opc.x_position,
- opc.y_position,
- opc.img_x_position,
- opc.img_y_position,
- opc.width,
- opc.height,
- opc.ratio,
- opc.unit,
- opc.info,
- opc.remark,
- opc.created_user_id,
- opc.update_user_id,
- opc.created_time,
- opc.update_time
- </sql>
- <sql id="Ref_Column_List">
- opc.sb_id,
- opc.sb_name,
- opc.position_num,
- opc.line,
- opc.type,
- opc.info,
- opc.warn_first,
- opc.warn_second,
- opc.warn_third,
- opc.warn_four,
- opc.low,
- opc.high,
- opc.description,
- opc.result,
- opc.av_flag,
- opc.port_flag,
- opc.fetch_flag,
- opc.created_flag,
- opc.position_flag,
- opc.x_position,
- opc.y_position,
- opc.img_x_position,
- opc.img_y_position,
- opc.width,
- opc.height,
- opc.ratio,
- opc.unit,
- opc.remark,
- </sql>
- <sql id="List_Condition">
- <if test="id != null and id != ''">
- and opc.id = #{id}
- </if>
- <if test="createdFlag != null">
- and opc.created_flag = #{createdFlag}
- </if>
- <if test="avFlag != null">
- and opc.av_flag = #{avFlag}
- </if>
- <if test="portFlag != null">
- and opc.port_flag = #{portFlag}
- </if>
- <if test="fetchFlag != null">
- and opc.fetch_flag = #{fetchFlag}
- </if>
- <if test="positionFlag != null">
- and opc.position_flag = #{positionFlag}
- </if>
- <if test="sbId != null and sbId != ''">
- and opc.sb_id = #{sbId}
- </if>
- <if test="sbName != null and sbName != ''">
- and opc.sb_name = #{sbName}
- </if>
- <if test="positionNum != null">
- and opc.position_num = #{positionNum}
- </if>
- <if test="line != null">
- and opc.line = #{line}
- </if>
- <if test="type != null">
- and opc.type = #{type}
- </if>
- <if test="description != null and description != ''">
- and opc.description = #{description}
- </if>
- <if test="result != null and result != ''">
- and opc.result = #{result}
- </if>
- <if test="ratio != null">
- and opc.ratio = #{ratio}
- </if>
- <if test="unit != null and unit != ''">
- and opc.unit = #{unit}
- </if>
- <if test="remark != null and remark != ''">
- and opc.remark = #{remark}
- </if>
- <if test="createdUserId != null and createdUserId != ''">
- and opc.created_user_id = #{createdUserId}
- </if>
- <if test="updateUserId != null and updateUserId != ''">
- and opc.update_user_id = #{updateUserId}
- </if>
- <if test="createdTimeStart != null">
- and opc.created_time <![CDATA[>=]]>; #{createdTimeStart}
- </if>
- <if test="createdTimeEnd != null">
- and opc.created_time <![CDATA[<=]]> #{createdTimeEnd}
- </if>
- <if test="createdTime != null">
- and opc.created_time = #{createdTime}
- </if>
- <if test="updateTimeStart != null">
- and opc.update_time <![CDATA[>=]]>; #{updateTimeStart}
- </if>
- <if test="updateTimeEnd != null">
- and opc.update_time <![CDATA[<=]]> #{updateTimeEnd}
- </if>
- <if test="updateTime != null">
- and opc.update_time = #{updateTime}
- </if>
- <if test="keyword != null and keyword != ''">
- and (
- opc.sb_name like concat(concat('%',#{keyword}),'%')
- or opc.position_num like concat(concat('%',#{keyword}),'%')
- )
- </if>
- <if test="ids != null">
- AND opc.id in
- <foreach item="item" index="index" collection="ids" open="(" close=")" separator=",">
- #{item}
- </foreach>
- </if>
- </sql>
- <select id="selectList" parameterType="com.platform.dao.dto.remote.RemoteOpcDTO"
- resultType="com.platform.dao.vo.query.remote.RemoteOpcVO">
- select opc.*, position.name as positionName
- from t_remote_opc as opc
- left join t_sb_position position on opc.line = position.id
- <where>
- <include refid="List_Condition"/>
- </where>
- </select>
- <update id="updateBatch" parameterType="java.util.List">
- <foreach collection="list" item="item" index="index" open="" close="" separator=";">
- update t_remote_opc
- <set>
- <if test="item.result != null and item.result != ''">
- result = #{item.result},
- </if>
- <if test="item.remark != null and item.remark != ''">
- remark = #{item.remark},
- </if>
- <if test="item.updateUserId != null">
- update_user_id = #{item.updateUserId},
- </if>
- <if test="item.updateTime != null">
- update_time = #{item.updateTime}
- </if>
- <if test="item.avFlag != null">
- av_flag = #{item.avFlag}
- </if>
- <if test="item.createdFlag != null">
- created_flag = #{item.createdFlag}
- </if>
- <if test="item.positionFlag != null">
- position_flag = #{item.positionFlag}
- </if>
- <if test="item.fetchFlag != null">
- fetch_flag = #{fetchFlag}
- </if>
- <if test="item.portFlag != null">
- port_flag = #{portFlag}
- </if>
- <if test="item.xPosition != null">
- x_position = #{item.xPosition}
- </if>
- <if test="item.yPosition != null">
- y_position = #{item.yPosition}
- </if>
- <if test="item.width != null">
- width = #{item.width}
- </if>
- <if test="item.height != null">
- height = #{item.height}
- </if>
- </set>
- where position_num = #{item.positionNum}
- </foreach>
- </update>
- </mapper>
|