You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
64 lines
2.4 KiB
64 lines
2.4 KiB
<?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.swlscx.excerpt.mapper.HyWsfhexBMapper"> |
|
|
|
<select id="selectHyWsfhexBPageByInfo" resultType="com.ruoyi.swlscx.excerpt.domain.vo.HyWsfhexBVo"> |
|
select hme.stcd, |
|
hme.tm, |
|
hme.upz, |
|
hme.upzrcd, |
|
hme.dwz, |
|
hme.dwzrcd, |
|
hme.q, |
|
hme.s, |
|
hsa.stnm |
|
from hy_wsfhex_b hme |
|
left join hy_stsc_a hsa on hme.stcd = hsa.stcd |
|
<where> |
|
<trim prefixOverrides="and"> |
|
<if test="map.stnm != null and map.stnm != ''"> |
|
and hsa.stnm like concat('%',#{map.stnm},'%') |
|
</if> |
|
<if test="map.stcd != null and map.stcd.size >0"> |
|
and hme.stcd in |
|
<foreach collection="map.stcd" item="stcd" separator="," open="(" close=")"> |
|
#{stcd} |
|
</foreach> |
|
</if> |
|
<if test="map.startTime != null and map.startTime != ''"> |
|
and hme.tm >= #{map.startTime} |
|
</if> |
|
<if test="map.endTime != null and map.endTime != ''"> |
|
and hme.tm <= #{map.endTime} |
|
</if> |
|
</trim> |
|
</where> |
|
order by hme.tm |
|
</select> |
|
|
|
<delete id="deleteTempData"> |
|
TRUNCATE TABLE hy_wsfhex_b_temp; |
|
</delete> |
|
|
|
<insert id="insertTempData" parameterType="list"> |
|
INSERT INTO hy_wsfhex_b_temp(stcd, tm, upz, upzrcd, dwz, dwzrcd, q, s) |
|
VALUES |
|
<foreach collection="list" item="item" separator=","> |
|
(#{item.stcd}, #{item.tm,jdbcType=TIMESTAMP}, #{item.upz}, #{item.upzrcd}, #{item.dwz}, #{item.dwzrcd}, #{item.q}, #{item.s}) |
|
</foreach> |
|
</insert> |
|
|
|
<insert id="mergeToData"> |
|
MERGE INTO hy_wsfhex_b AS a |
|
USING hy_wsfhex_b_temp AS temp |
|
ON (a.stcd = temp.stcd AND a.tm = temp.tm AND a.upz = temp.upz AND a.upzrcd = temp.upzrcd AND a.dwz = temp.dwz AND a.dwzrcd = temp.dwzrcd) |
|
WHEN MATCHED THEN |
|
UPDATE SET a.q = temp.q, a.s = temp.s |
|
WHEN NOT MATCHED THEN |
|
INSERT (stcd, tm, upz, upzrcd, dwz, dwzrcd, q, s) |
|
VALUES (temp.stcd, temp.tm, temp.upz, temp.upzrcd, temp.dwz, temp.dwzrcd, temp.q, temp.s); |
|
</insert> |
|
|
|
</mapper>
|
|
|