代码优化部门

This commit is contained in:
TL
2025-07-17 08:47:50 +08:00
parent b6f22eb121
commit ffcb1db56c
16 changed files with 157 additions and 131 deletions

View File

@ -15,7 +15,8 @@
<result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/>
<result property="lastUpdateTime" column="last_update_time"/>
<result property="deptId" column="dept_id"/>
<result property="supplierexitId" column="supplierexit_id"/>
<result property="deptId" column="dept_id"/>
</resultMap>
<sql id="selectCoscoAccessSupplierCategoryVo">
@ -32,50 +33,34 @@
c.update_by,
c.update_time,
c.last_update_time,
c.dept_id
c.dept_id,
c.supplierexit_id,
cse.exit_time as exitTime,
cse.exit_reason as exitReason
FROM
cosco_access_supplier_category c
left join cosco_supplier_base s on c.supplier_id = s.id and s.del_flag = 'normal'
left join cosco_category ca on c.category_id = ca.id and ca.del_flag = 'normal'
left join cosco_supplierexit cse on c.supplierexit_id = cse.id and cse.del_flag = 'normal'
</sql>
<select id="selectPageList" parameterType="com.chinaunicom.zyhy.ebtp.supplier.coscosupplier.vo.AdmissionDetailsVo" resultType="com.chinaunicom.zyhy.ebtp.supplier.coscosupplier.vo.AdmissionDetailsVo">
SELECT
caw.update_time as updateTime,
cas.dept_id as deptId,
cas.supplierexit_id as supplierexitId,
cse.exit_time as exitTime,
cse.exit_reason as exitReason,
c.categoryNames
FROM
cosco_access_supplier cas
LEFT JOIN cosco_supplierexit cse ON cse.id = cas.supplierexit_id
LEFT JOIN cosco_access_work caw ON caw.id = cas.access_work_id
left join (
SELECT
cac.access_work_id,
GROUP_CONCAT(cc.id SEPARATOR ', ') AS categoryId,
GROUP_CONCAT(cc.category_name SEPARATOR ', ') AS categoryNames
FROM cosco_access_supplier_category cac
INNER JOIN cosco_category cc ON cac.category_id = cc.id
GROUP BY cac.access_work_id
) as c on c.access_work_id = caw.id
WHERE
cas.supplier_id = #{vo.supplierId} AND cas.access_status IN (1,2)
<if test="vo.categoryNames != null and vo.categoryNames != ''">
and c.categoryNames like concat('%', #{vo.categoryNames}, '%')
</if>
<if test="vo.categoryId != null and vo.categoryId != ''">
and c.categoryId like concat('%', #{vo.categoryId}, '%')
</if>
<if test="vo.startTime!=null and vo.startTime != ''">
and caw.update_time &gt;= #{vo.startTime}
</if>
<if test="vo.endTime!=null and vo.endTime != ''">
and caw.update_time &lt;= #{vo.endTime}
</if>
ORDER BY caw.update_time desc
<select id="selectPageList" parameterType="com.chinaunicom.zyhy.ebtp.supplier.coscosupplier.entity.CoscoAccessSupplierCategory" resultMap="CoscoAccessSupplierCategoryResult">
<include refid="selectCoscoAccessSupplierCategoryVo"/>
<where>
<if test="vo.supplierId != null and vo.supplierId != ''">
and c.supplier_id = #{vo.supplierId}
</if>
<if test="vo.categoryId != null and vo.categoryId != ''">
and c.categoryId = #{vo.categoryId}
</if>
<if test="vo.startTime!=null and vo.startTime != ''">
and c.create_time &gt;= #{vo.startTime}
</if>
<if test="vo.endTime!=null and vo.endTime != ''">
and c.create_time &lt;= #{vo.endTime}
</if>
</where>
ORDER BY c.create_time desc
</select>
<select id="selectCoscoAccessSupplierCategoryList" parameterType="com.chinaunicom.zyhy.ebtp.supplier.coscosupplier.entity.CoscoAccessSupplierCategory" resultMap="CoscoAccessSupplierCategoryResult">
@ -228,6 +213,7 @@
<if test="updateTime != null">update_time,</if>
<if test="lastUpdateTime != null">last_update_time,</if>
<if test="deptId != null">dept_id,</if>
<if test="supplierexitId != null">supplierexit_id,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
@ -241,6 +227,7 @@
<if test="updateTime != null">#{updateTime},</if>
<if test="lastUpdateTime != null">#{lastUpdateTime},</if>
<if test="deptId != null">#{deptId},</if>
<if test="supplierexitId != null">#{supplierexitId},</if>
</trim>
</insert>
<insert id="batchCoscoAccessSupplierCategory" parameterType="java.util.List">
@ -284,6 +271,9 @@
<if test="deptId != null">dept_id =
#{deptId},
</if>
<if test="supplierexitId != null">supplierexit_id =
#{supplierexitId},
</if>
</trim>
where id = #{id}
</update>
@ -303,7 +293,7 @@
<update id="batchDeleteCoscoAccessSupplierCategory" parameterType="map">
UPDATE cosco_access_supplier_category
SET del_flag = 'deleted'
SET del_flag = 'deleted',supplierexit_id = #{supplierexitId}
WHERE dept_id = #{deptId}
<if test="coscoAccessSupplierCategoryList != null and coscoAccessSupplierCategoryList.size() > 0">
AND (

View File

@ -361,7 +361,10 @@
<where>
AND caw.apply_type = '0'
<if test="vo.createBy != null and vo.createBy != ''">
and caw.create_by = #{vo.createBy}
and caw.create_by = #{vo.createBy}
</if>
<if test="vo.accessStatus != null and vo.accessStatus != ''">
and caw.approve_status = #{vo.accessStatus}
</if>
<if test="vo.categoryId != null and vo.categoryId != ''">
and cc.id = #{vo.categoryId}