120 lines
5.0 KiB
XML
120 lines
5.0 KiB
XML
<?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.ruoyi.system.mapper.PrimaryRadarDataMapper">
|
|
|
|
<resultMap type="com.ruoyi.common.core.domain.entity.PrimaryRadarData" id="PrimaryRadarDataResult">
|
|
<id property="id" column="id" />
|
|
<result property="tagId" column="tag_id" />
|
|
<result property="value1" column="value1" />
|
|
<result property="value2" column="value2" />
|
|
<result property="value3" column="value3" />
|
|
<result property="value4" column="value4" />
|
|
<result property="value5" column="value5" />
|
|
<result property="baseLine" column="base_line" />
|
|
<result property="queryFre" column="query_fre" />
|
|
<result property="number" column="number" />
|
|
<result property="radarLocation" column="radar_location" />
|
|
<result property="ladleNumber" column="ladle_number" />
|
|
<result property="stationCode" column="station_code" />
|
|
<result property="radarIp" column="radar_ip" />
|
|
<result property="totalCount" column="total_count" />
|
|
<result property="type" column="type" />
|
|
<result property="createBy" column="create_by" />
|
|
<result property="createTime" column="create_time" />
|
|
<result property="updateBy" column="update_by" />
|
|
<result property="updateTime" column="update_time" />
|
|
<result property="remark" column="remark" />
|
|
<result property="delFlag" column="del_flag" />
|
|
</resultMap>
|
|
|
|
<select id="selectPrimaryRadarDataList" resultMap="PrimaryRadarDataResult">
|
|
select p.id,p.tag_id,p.value1,p.value2,p.value3,p.value4,p.value5,p.base_line,p.query_fre,p.number,p.radar_location,p.ladle_number,p.radar_ip, p.station_code,p.type,p.create_by,p.create_time,p.update_by,p.update_time,p.remark,p.del_flag from sys_primary_radar_data p
|
|
where p.del_flag = '0'
|
|
<if test="radarLocation != null and radarLocation != ''">
|
|
AND p.radar_location like concat('%',#{radarLocation}, '%')
|
|
</if>
|
|
<if test="ladleNumber != null and ladleNumber != ''">
|
|
AND p.ladle_number like concat('%',#{ladleNumber}, '%')
|
|
</if>
|
|
<if test="tagId != null and tagId != ''">
|
|
AND p.tag_id like concat('%',#{tagId},'%')
|
|
</if>
|
|
<if test="createTime != null and updateTime != null">
|
|
AND DATE_FORMAT(p.update_time,'%Y-%m-%d') between DATE_FORMAT(#{createTime},'%Y-%m-%d') and DATE_FORMAT(#{updateTime},'%Y-%m-%d')
|
|
</if>
|
|
</select>
|
|
|
|
<insert id="insertPrimaryRadarData">
|
|
insert into sys_primary_radar_data(
|
|
<if test="id != null and id != 0">id,</if>
|
|
<if test="tagId != null and tagId != ''">tag_id,</if>
|
|
value1,
|
|
value2,
|
|
value3,
|
|
value4,
|
|
value5,
|
|
base_line,
|
|
query_fre,
|
|
station_code,
|
|
number,
|
|
type,
|
|
<if test="radarLocation != null and radarLocation != ''">radar_location,</if>
|
|
<if test="ladleNumber != null and ladleNumber != ''">ladle_number,</if>
|
|
<if test="radarIp != null and radarIp != ''">radar_ip,</if>
|
|
<if test="createBy != null and createBy != ''">create_by,</if>
|
|
<if test="remark != null and remark != ''">remark,</if>
|
|
create_time,
|
|
update_time
|
|
)values(
|
|
<if test="id != null and id != 0">#{id},</if>
|
|
<if test="tagId != null and tagId != ''">#{tagId},</if>
|
|
#{value1},
|
|
#{value2},
|
|
#{value3},
|
|
#{value4},
|
|
#{value5},
|
|
#{baseLine},
|
|
#{queryFre},
|
|
#{stationCode},
|
|
#{number},
|
|
#{type},
|
|
<if test="radarLocation != null and radarLocation != ''">#{radarLocation},</if>
|
|
<if test="ladleNumber != null and ladleNumber != ''">#{ladleNumber},</if>
|
|
<if test="radarIp != null and radarIp != ''">#{radarIp},</if>
|
|
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
|
<if test="remark != null and remark != ''">#{remark},</if>
|
|
sysdate(),
|
|
sysdate()
|
|
)
|
|
</insert>
|
|
|
|
|
|
<select id="selectRadarTable" resultMap="PrimaryRadarDataResult">
|
|
|
|
SELECT radar_location, ladle_number, number, value4, radar_ip, tag_id, create_time, update_time, total_count
|
|
FROM (
|
|
SELECT radar_location, ladle_number, number, value4, radar_ip, tag_id, create_time, update_time,
|
|
COUNT(*) OVER (PARTITION BY radar_location, ladle_number, number, value4, radar_ip, tag_id) AS total_count,
|
|
ROW_NUMBER() OVER (PARTITION BY radar_location, ladle_number, number, value4, radar_ip, tag_id
|
|
ORDER BY create_time, update_time) AS row_num
|
|
FROM sys_primary_radar_data
|
|
) subquery
|
|
WHERE row_num = 1
|
|
<if test="tagId != null and tagId != ''">
|
|
AND tag_id like concat('%',#{tagId}, '%')
|
|
</if>
|
|
<if test="radarLocation != null and radarLocation != ''">
|
|
AND radar_location like concat('%',#{radarLocation}, '%')
|
|
</if>
|
|
<if test="type != null and type != ''">
|
|
AND ladle_number like concat('%',#{type}, '%')
|
|
</if>
|
|
<if test="createTime != null and updateTime != null">
|
|
AND DATE_FORMAT(update_time,'%Y-%m-%d') between DATE_FORMAT(#{createTime},'%Y-%m-%d') and DATE_FORMAT(#{updateTime},'%Y-%m-%d')
|
|
</if>
|
|
</select>
|
|
|
|
|
|
</mapper> |