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.

149 lines
4.2 KiB

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
5 months ago
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.tc.mapper.AssetCurrentMapper">
<delete id="deleteIdList">
DELETE FROM asset_current
WHERE id IN
<foreach item="id" index="index" collection="idList" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
5 months ago
<select id="page" resultType="com.ruoyi.tc.entity.AssetCurrent">
select * from asset_current
<where>
del_flag = '0'
<if test="req.xtmc!=null and req.xtmc!='' ">
5 months ago
and xtmc like concat('%',#{req.xtmc},'%')
</if>
<if test="req.dwmc!=null and req.dwmc!='' ">
5 months ago
and dwmc like concat('%',#{req.dwmc},'%')
</if>
5 months ago
<if test="req.xtlx!=null">
and xtlx = #{req.xtlx}
</if>
<if test="req.xtzt!=null">
5 months ago
and xtzt = #{req.xtzt}
</if>
<if test="req.startTime != null ">
and create_time &gt;= #{req.startTime}
</if>
<if test="req.endTime != null">
and create_time &lt;= #{req.endTime}
</if>
</where>
5 months ago
order by create_time desc
</select>
5 months ago
5 months ago
<select id="page1" resultType="com.ruoyi.tc.entity.AssetExport">
SELECT
a.*,
b.*,
c.*,
d.*,
e.*,
l.*
FROM
asset_current a
LEFT JOIN ( SELECT asset_id, NAME, tyshxydm, lxr, lxdh, gyszcdz, sfwtc FROM asset_supply_chain WHERE type = 5 GROUP BY asset_id,NAME, tyshxydm, lxr, lxdh, gyszcdz, sfwtc ) b ON a.id = b.asset_id
5 months ago
LEFT JOIN (
SELECT
asset_id,
NAME AS name1,
tyshxydm AS tyshxydm1,
lxr AS lxr1,
lxdh AS lxdh1,
gyszcdz AS gyszcdz1,
sfwtc AS sfwtc1
FROM
asset_supply_chain
WHERE
type = 7
GROUP BY
asset_id,
NAME,
tyshxydm,
lxr,
lxdh,
gyszcdz,
sfwtc
5 months ago
) c ON a.id = c.asset_id
LEFT JOIN (
SELECT
asset_id,
sblx,
pp,
sb_ip AS sbIp,
czxt,
czxtbb,
yjxh,
yjxlh,
yjbbxx,
yjyt,
yjbsxx
FROM
asset_basic_network
WHERE
type = 1
GROUP BY
asset_id,
sblx,
pp,
sb_ip,
czxt,czxtbb,yjxh,yjxlh,yjbbxx,yjyt,yjbsxx
5 months ago
) d ON a.id = d.asset_id
LEFT JOIN (
SELECT
asset_id,
sblx AS wlsblx,
pp AS wlpp,
sb_ip AS wlsbIp,
yjxh AS wlyjxh,
yjxlh AS wlyjxlh,
yjbbxx AS wlyjbbxx,
yjyt AS wlyjyt,
yjbsxx AS wlyjbsxx
FROM
asset_basic_network
WHERE
type = 2
GROUP BY
asset_id,
sblx,
pp,sb_ip,yjxh,yjxlh,yjbbxx,yjyt,yjbsxx
5 months ago
) e ON a.id = e.asset_id
LEFT JOIN ( SELECT
asset_id, sblx AS aqwlsblx, pp AS aqwlpp, sb_ip AS aqwlsbIp
FROM asset_basic_network WHERE type = 3 GROUP BY asset_id,sblx,pp,sb_ip ) l ON a.id = l.asset_id
5 months ago
<where>
a.del_flag = '0' and a.isbf = '0'
<if test="req.xtmc!=null and req.xtmc!='' ">
and a.xtmc like concat('%',#{req.xtmc},'%')
</if>
<if test="req.dwmc!=null and req.dwmc!='' ">
and a.dwmc like concat('%',#{req.dwmc},'%')
</if>
<if test="req.xtlx!=null">
and a.xtlx = #{req.xtlx}
</if>
<if test="req.xtzt!=null">
and a.xtzt = #{req.xtzt}
</if>
<if test="req.startTime != null ">
and a.create_time &gt;= #{req.startTime}
</if>
<if test="req.endTime != null">
and a.create_time &lt;= #{req.endTime}
</if>
</where>
5 months ago
order by create_time desc
5 months ago
</select>
5 months ago
<update id="deleteByUnitIds">
5 months ago
update asset_current
set del_flag = '2'
where id = #{id}
5 months ago
</update>
</mapper>