修改去重逻辑

This commit is contained in:
yangjun 2023-10-25 21:10:04 +08:00
parent 4509150f2b
commit e8bddbd110
1 changed files with 5 additions and 12 deletions

View File

@ -89,17 +89,10 @@
</insert>
<delete id="removeCfsj" parameterType="org.jeecg.modules.kc.ktgl.entity.KcKechengbiao">
DELETE FROM kc_kechengbiao
WHERE xqxn = #{xqxn}
AND id NOT IN (
SELECT maxid FROM
( SELECT
kcbh,kcmc,skjs,zc,xkrs,pkrs,rwbh,kkdw,kcxz,skdd,sksj,jkzc,hh,WEEK,hhks,hhjs,zbfs,kkdwid,jkzc1,xf,xq,jgh,jzglb,sfcj,szkc,xqxn,max( id ) AS maxid
FROM kc_kechengbiao t
WHERE xqxn = #{xqxn}
GROUP BY
kcbh,kcmc,skjs,zc,xkrs,pkrs,rwbh,kkdw,kcxz,skdd,sksj,jkzc,hh,WEEK,hhks,hhjs,zbfs,kkdwid,jkzc1,xf,xq,jgh,jzglb,sfcj,szkc,xqxn
) a)
select * from kc_kechengbiao where xqxn = #{xqxn} and id not in (
select maxid from (
select kcbh,kcmc,skjs,rwbh,kkdw,kcxz,skdd,sksj,kkdwid,xq,jgh,jzglb,sfcj,xqxn,max(id) as maxid from
kc_kechengbiao t where t.xqxn = #{xqxn}
GROUP BY kcbh,kcmc,skjs,rwbh,kkdw,kcxz,skdd,sksj,kkdwid,xq,jgh,jzglb,sfcj,xqxn)a)
</delete>
</mapper>