|
@@ -1,46 +1,49 @@
|
|
|
<?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">
|
|
|
+ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
+ "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
<mapper namespace="com.ruoyi.biz.mapper.TwinPanHeadInfoMapper">
|
|
|
-
|
|
|
+
|
|
|
<resultMap type="TwinPanHeadInfo" id="TwinPanHeadInfoResult">
|
|
|
- <result property="infoId" column="INFO_ID" />
|
|
|
- <result property="deviceId" column="DEVICE_ID" />
|
|
|
- <result property="phNum" column="PH_NUM" />
|
|
|
- <result property="phMax" column="PH_MAX" />
|
|
|
- <result property="recordTime" column="RECORD_TIME" />
|
|
|
- <result property="createdBy" column="CREATED_BY" />
|
|
|
- <result property="createdTime" column="CREATED_TIME" />
|
|
|
- <result property="updatedBy" column="UPDATED_BY" />
|
|
|
- <result property="updatedTime" column="UPDATED_TIME" />
|
|
|
- <result property="remark" column="REMARK" />
|
|
|
+ <result property="infoId" column="INFO_ID"/>
|
|
|
+ <result property="deviceId" column="DEVICE_ID"/>
|
|
|
+ <result property="phNum" column="PH_NUM"/>
|
|
|
+ <result property="phMax" column="PH_MAX"/>
|
|
|
+ <result property="recordTime" column="RECORD_TIME"/>
|
|
|
+ <result property="createdBy" column="CREATED_BY"/>
|
|
|
+ <result property="createdTime" column="CREATED_TIME"/>
|
|
|
+ <result property="updatedBy" column="UPDATED_BY"/>
|
|
|
+ <result property="updatedTime" column="UPDATED_TIME"/>
|
|
|
+ <result property="remark" column="REMARK"/>
|
|
|
</resultMap>
|
|
|
|
|
|
<sql id="selectTwinPanHeadInfoVo">
|
|
|
- select INFO_ID, DEVICE_ID, PH_NUM, PH_MAX, RECORD_TIME, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME, REMARK from twin_pan_head_info
|
|
|
+ SELECT INFO_ID, DEVICE_ID, PH_NUM, PH_MAX, RECORD_TIME, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME, REMARK
|
|
|
+ FROM (SELECT *, ROW_NUMBER() OVER (PARTITION BY DEVICE_ID,PH_NUM ORDER BY RECORD_TIME DESC) AS RN
|
|
|
+ FROM TWIN_PAN_HEAD_INFO) T
|
|
|
+ WHERE RN = 1 ORDER BY RECORD_TIME DESC
|
|
|
</sql>
|
|
|
|
|
|
<select id="selectTwinPanHeadInfoList" parameterType="TwinPanHeadInfo" resultMap="TwinPanHeadInfoResult">
|
|
|
<include refid="selectTwinPanHeadInfoVo"/>
|
|
|
- <where>
|
|
|
- <if test="deviceId != null "> and DEVICE_ID = #{deviceId}</if>
|
|
|
- <if test="phNum != null "> and PH_NUM = #{phNum}</if>
|
|
|
- <if test="phMax != null "> and PH_MAX = #{phMax}</if>
|
|
|
- <if test="recordTime != null "> and RECORD_TIME = #{recordTime}</if>
|
|
|
- <if test="createdBy != null and createdBy != ''"> and CREATED_BY = #{createdBy}</if>
|
|
|
- <if test="createdTime != null "> and CREATED_TIME = #{createdTime}</if>
|
|
|
- <if test="updatedBy != null and updatedBy != ''"> and UPDATED_BY = #{updatedBy}</if>
|
|
|
- <if test="updatedTime != null "> and UPDATED_TIME = #{updatedTime}</if>
|
|
|
- <if test="remark != null and remark != ''"> and REMARK = #{remark}</if>
|
|
|
+ <where>
|
|
|
+ <if test="deviceId != null ">and DEVICE_ID = #{deviceId}</if>
|
|
|
+ <if test="phNum != null ">and PH_NUM = #{phNum}</if>
|
|
|
+ <if test="phMax != null ">and PH_MAX = #{phMax}</if>
|
|
|
+ <if test="recordTime != null ">and RECORD_TIME = #{recordTime}</if>
|
|
|
+ <if test="createdBy != null and createdBy != ''">and CREATED_BY = #{createdBy}</if>
|
|
|
+ <if test="createdTime != null ">and CREATED_TIME = #{createdTime}</if>
|
|
|
+ <if test="updatedBy != null and updatedBy != ''">and UPDATED_BY = #{updatedBy}</if>
|
|
|
+ <if test="updatedTime != null ">and UPDATED_TIME = #{updatedTime}</if>
|
|
|
+ <if test="remark != null and remark != ''">and REMARK = #{remark}</if>
|
|
|
</where>
|
|
|
</select>
|
|
|
-
|
|
|
+
|
|
|
<select id="selectTwinPanHeadInfoByInfoId" parameterType="Long" resultMap="TwinPanHeadInfoResult">
|
|
|
<include refid="selectTwinPanHeadInfoVo"/>
|
|
|
where INFO_ID = #{infoId}
|
|
|
</select>
|
|
|
-
|
|
|
+
|
|
|
<insert id="insertTwinPanHeadInfo" parameterType="TwinPanHeadInfo" useGeneratedKeys="true" keyProperty="infoId">
|
|
|
insert into twin_pan_head_info
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
@@ -53,7 +56,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="updatedBy != null">UPDATED_BY,</if>
|
|
|
<if test="updatedTime != null">UPDATED_TIME,</if>
|
|
|
<if test="remark != null">REMARK,</if>
|
|
|
- </trim>
|
|
|
+ </trim>
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
<if test="deviceId != null">#{deviceId},</if>
|
|
|
<if test="phNum != null">#{phNum},</if>
|
|
@@ -64,7 +67,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="updatedBy != null">#{updatedBy},</if>
|
|
|
<if test="updatedTime != null">#{updatedTime},</if>
|
|
|
<if test="remark != null">#{remark},</if>
|
|
|
- </trim>
|
|
|
+ </trim>
|
|
|
</insert>
|
|
|
|
|
|
<update id="updateTwinPanHeadInfo" parameterType="TwinPanHeadInfo">
|
|
@@ -84,14 +87,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</update>
|
|
|
|
|
|
<delete id="deleteTwinPanHeadInfoByInfoId" parameterType="Long">
|
|
|
- delete from twin_pan_head_info where INFO_ID = #{infoId}
|
|
|
+ delete
|
|
|
+ from twin_pan_head_info
|
|
|
+ where INFO_ID = #{infoId}
|
|
|
</delete>
|
|
|
|
|
|
<delete id="deleteTwinPanHeadInfoByInfoIds" parameterType="String">
|
|
|
- delete from twin_pan_head_info where INFO_ID in
|
|
|
+ delete from twin_pan_head_info where INFO_ID in
|
|
|
<foreach item="infoId" collection="array" open="(" separator="," close=")">
|
|
|
#{infoId}
|
|
|
</foreach>
|
|
|
</delete>
|
|
|
|
|
|
-</mapper>
|
|
|
+</mapper>
|