供应品类退出

This commit is contained in:
TL
2025-06-18 13:04:28 +08:00
parent be9783cfcc
commit 37b2daa04f
25 changed files with 1444 additions and 31 deletions

View File

@ -18,29 +18,86 @@
</resultMap>
<sql id="selectCoscoAccessSupplierCategoryVo">
select id, access_work_id, supplier_id, category_id, del_flag, create_by, create_time, update_by, update_time, last_update_time
from cosco_access_supplier_category
SELECT
s.`name`,
ca.category_name,
c.id,
c.access_work_id,
c.supplier_id,
c.category_id,
c.del_flag,
c.create_by,
c.create_time,
c.update_by,
c.update_time,
c.last_update_time
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'
</sql>
<select id="selectCoscoAccessSupplierCategoryList" parameterType="com.chinaunicom.zyhy.ebtp.supplier.coscosupplier.entity.CoscoAccessSupplierCategory" resultMap="CoscoAccessSupplierCategoryResult">
<include refid="selectCoscoAccessSupplierCategoryVo"/>
<where>
c.del_flag = 'normal'
<if test="accessWorkId != null and accessWorkId != ''">
and access_work_id = #{accessWorkId}
and c.access_work_id = #{accessWorkId}
</if>
<if test="supplierId != null and supplierId != ''">
and supplier_id = #{supplierId}
and c.supplier_id = #{supplierId}
</if>
<if test="categoryId != null and categoryId != ''">
and category_id = #{categoryId}
and c.category_id = #{categoryId}
</if>
<if test="lastUpdateTime != null ">
and last_update_time = #{lastUpdateTime}
and c.last_update_time = #{lastUpdateTime}
</if>
</where>
order by c.create_time desc
</select>
<select id="selectExitCategoryList" parameterType="com.chinaunicom.zyhy.ebtp.supplier.coscosupplier.entity.CoscoAccessSupplierCategory" resultMap="CoscoAccessSupplierCategoryResult">
SELECT
s.`name` as supplierName,
ca.category_name as categoryName,
es.review_result as reviewResult,
es.evaTime,
c.id,
c.access_work_id,
c.supplier_id,
c.category_id,
c.del_flag,
c.create_by,
c.create_time,
c.update_by,
c.update_time,
c.last_update_time
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 (
select e.supplier_id,e.update_time as evaTime,e.review_result from cosco_evaluate_task_supplier e
where e.del_flag = 'normal'
order by e.update_time desc
LIMIT 1
) es on es.supplier_id = s.id
where c.del_flag = 'normal' and s.access_status = 1 and s.blacklist_status = 0 and s.greylist_status = 0
<if test="vo.supplierName != null and vo.supplierName != ''">
and s.name like concat('%', #{vo.supplierName}, '%')
</if>
<if test="vo.categoryId != null and vo.categoryId != ''">
and c.category_id = #{vo.categoryId}
</if>
<if test="vo.reviewResult != null and vo.reviewResult != ''">
and review_result = #{vo.reviewResult}
</if>
</select>
<select id="selectBySupplierIdAndCategoryId" parameterType="com.chinaunicom.zyhy.ebtp.supplier.coscosupplier.entity.CoscoAccessSupplierCategory" resultType="Integer">
select COUNT(0) from cosco_access_supplier_category
where supplier_id = #{supplierId}
@ -124,9 +181,9 @@
where id = #{id}
</update>
<update id="deleteCoscoAccessSupplierCategoryById" parameterType="String">
update cosco_access_supplier_category set del_flag = 2
where id = #{id}
<update id="deleteCoscoAccessSupplierCategoryById" parameterType="com.chinaunicom.zyhy.ebtp.supplier.coscosupplier.entity.CoscoAccessSupplierCategory">
update cosco_access_supplier_category set del_flag = 'deleted'
where supplier_id = #{supplierId} and category_id = #{categoryId}
</update>
<update id="deleteCoscoAccessSupplierCategoryByIds" parameterType="String">

View File

@ -0,0 +1,191 @@
<?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.chinaunicom.zyhy.ebtp.supplier.coscosupplier.dao.mapper.CoscoSupplierexitMapper">
<resultMap type="com.chinaunicom.zyhy.ebtp.supplier.coscosupplier.entity.CoscoSupplierexit" id="CoscoSupplierexitResult">
<result property="id" column="id"/>
<result property="exitTheme" column="exit_theme"/>
<result property="exitReason" column="exit_reason"/>
<result property="deptId" column="dept_id"/>
<result property="approveStatus" column="approve_status"/>
<result property="workFlowId" column="work_flow_id"/>
<result property="delFlag" column="del_flag"/>
<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="lastUpdateTime" column="last_update_time"/>
</resultMap>
<sql id="selectCoscoSupplierexitVo">
SELECT
id,
exit_theme,
dept_id,
CASE
WHEN approve_status = 0 THEN '待审批'
WHEN approve_status = 1 THEN '通过'
WHEN approve_status = 2 THEN '驳回'
END AS approveStatusText,
work_flow_id,
create_by,
create_time
FROM
cosco_supplierexit
</sql>
<select id="selectPageList" parameterType="com.chinaunicom.zyhy.ebtp.supplier.coscosupplier.entity.CoscoSupplierexit" resultMap="CoscoSupplierexitResult">
<include refid="selectCoscoSupplierexitVo"/>
<where>
and del_flag = 'normal'
<if test="vo.exitTheme != null and vo.exitTheme != ''">
and exit_theme like concat('%', #{vo.exitTheme}, '%')
</if>
<if test="vo.exitReason != null and vo.exitReason != ''">
and exit_reason = #{vo.exitReason}
</if>
<if test="vo.deptId != null and vo.deptId != ''">
and dept_id = #{vo.deptId}
</if>
<if test="vo.approveStatus != null ">
and approve_status = #{vo.approveStatus}
</if>
<if test="vo.workFlowId != null and vo.workFlowId != ''">
and work_flow_id = #{vo.workFlowId}
</if>
<if test="vo.lastUpdateTime != null ">
and last_update_time = #{vo.astUpdateTime}
</if>
<if test="vo.startTime!=null and vo.startTime != ''">
and create_time &gt;= #{vo.startTime}
</if>
<if test="vo.endTime!=null and vo.endTime != ''">
and create_time &lt;= #{vo.endTime}
</if>
</where>
order by create_time desc
</select>
<select id="selectCoscoSupplierexitList" parameterType="com.chinaunicom.zyhy.ebtp.supplier.coscosupplier.entity.CoscoSupplierexit" resultMap="CoscoSupplierexitResult">
<include refid="selectCoscoSupplierexitVo"/>
<where>
<if test="exitTheme != null and exitTheme != ''">
and exit_theme = #{exitTheme}
</if>
<if test="exitReason != null and exitReason != ''">
and exit_reason = #{exitReason}
</if>
<if test="deptId != null and deptId != ''">
and dept_id = #{deptId}
</if>
<if test="approveStatus != null ">
and approve_status = #{approveStatus}
</if>
<if test="workFlowId != null and workFlowId != ''">
and work_flow_id = #{workFlowId}
</if>
<if test="lastUpdateTime != null ">
and last_update_time = #{lastUpdateTime}
</if>
</where>
</select>
<select id="selectCoscoSupplierexitById" parameterType="String"
resultMap="CoscoSupplierexitResult">
<include refid="selectCoscoSupplierexitVo"/>
where id = #{id}
</select>
<insert id="insertCoscoSupplierexit" parameterType="com.chinaunicom.zyhy.ebtp.supplier.coscosupplier.entity.CoscoSupplierexit">
insert into cosco_supplierexit
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="exitTheme != null">exit_theme,</if>
<if test="exitReason != null">exit_reason,</if>
<if test="deptId != null">dept_id,</if>
<if test="approveStatus != null">approve_status,</if>
<if test="workFlowId != null">work_flow_id,</if>
<if test="delFlag != null and delFlag != ''">del_flag,</if>
<if test="createBy != null and createBy != ''">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="lastUpdateTime != null">last_update_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="exitTheme != null">#{exitTheme},</if>
<if test="exitReason != null">#{exitReason},</if>
<if test="deptId != null">#{deptId},</if>
<if test="approveStatus != null">#{approveStatus},</if>
<if test="workFlowId != null">#{workFlowId},</if>
<if test="delFlag != null and delFlag != ''">#{delFlag},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="lastUpdateTime != null">#{lastUpdateTime},</if>
</trim>
</insert>
<insert id="batchCoscoSupplierexit" parameterType="java.util.List">
insert into cosco_supplierexit
( id, exit_theme, exit_reason, dept_id, approve_status, work_flow_id, del_flag, create_by, create_time, update_by, update_time, last_update_time)
values
<foreach item="item" index="index" collection="list" separator=",">
( #{item.id}, #{item.exitTheme}, #{item.exitReason}, #{item.deptId}, #{item.approveStatus}, #{item.workFlowId}, #{item.delFlag}, #{item.createBy}, #{item.createTime}, #{item.updateBy}, #{item.updateTime}, #{item.lastUpdateTime})
</foreach>
</insert>
<update id="updateCoscoSupplierexit" parameterType="com.chinaunicom.zyhy.ebtp.supplier.coscosupplier.entity.CoscoSupplierexit">
update cosco_supplierexit
<trim prefix="SET" suffixOverrides=",">
<if test="exitTheme != null">exit_theme =
#{exitTheme},
</if>
<if test="exitReason != null">exit_reason =
#{exitReason},
</if>
<if test="deptId != null">dept_id =
#{deptId},
</if>
<if test="approveStatus != null">approve_status =
#{approveStatus},
</if>
<if test="workFlowId != null">work_flow_id =
#{workFlowId},
</if>
<if test="delFlag != null and delFlag != ''">del_flag =
#{delFlag},
</if>
<if test="createBy != null and createBy != ''">create_by =
#{createBy},
</if>
<if test="createTime != null">create_time =
#{createTime},
</if>
<if test="updateBy != null">update_by =
#{updateBy},
</if>
<if test="updateTime != null">update_time =
#{updateTime},
</if>
<if test="lastUpdateTime != null">last_update_time =
#{lastUpdateTime},
</if>
</trim>
where id = #{id}
</update>
<update id="deleteCoscoSupplierexitById" parameterType="String">
update cosco_supplierexit set del_flag = 2
where id = #{id}
</update>
<update id="deleteCoscoSupplierexitByIds" parameterType="String">
update cosco_supplierexit set del_flag = 2 where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</update>
</mapper>

View File

@ -0,0 +1,107 @@
<?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.chinaunicom.zyhy.ebtp.supplier.coscosupplier.dao.mapper.CoscoSupplierexitSupplierCategoryMapper">
<resultMap type="com.chinaunicom.zyhy.ebtp.supplier.coscosupplier.entity.CoscoSupplierexitSupplierCategory" id="CoscoSupplierexitSupplierCategoryResult">
<result property="supplierexitId" column="supplierexit_id"/>
<result property="supplierId" column="supplier_id"/>
<result property="categoryId" column="category_id"/>
<result property="exitTheme" column="exit_theme"/>
<result property="deptId" column="dept_id"/>
<result property="createTime" column="create_time"/>
</resultMap>
<sql id="selectCoscoSupplierexitSupplierCategoryVo">
SELECT
e.exit_theme,
e.dept_id,
e.create_time,
s.`name` as supplierName,
ca.category_name as categoryName,
sc.supplierexit_id,
sc.supplier_id,
sc.category_id
FROM
cosco_supplierexit_supplier_category sc
left join cosco_supplierexit e on sc.supplierexit_id = e.id
left join cosco_supplier_base s on sc.supplier_id = s.id and s.del_flag = 'normal'
left join cosco_category ca on sc.category_id = ca.id and ca.del_flag = 'normal'
</sql>
<select id="selectPageList" parameterType="com.chinaunicom.zyhy.ebtp.supplier.coscosupplier.entity.CoscoSupplierexitSupplierCategory" resultMap="CoscoSupplierexitSupplierCategoryResult">
<include refid="selectCoscoSupplierexitSupplierCategoryVo"/>
<where>
and sc.supplierexit_id = #{vo.supplierexitId}
<if test="vo.exitTheme != null and vo.exitTheme != ''">
and e.exit_theme like concat('%', #{vo.exitTheme}, '%')
</if>
<if test="vo.startTime!=null and vo.startTime != ''">
and e.create_time &gt;= #{vo.startTime}
</if>
<if test="vo.endTime!=null and vo.endTime != ''">
and e.create_time &lt;= #{vo.endTime}
</if>
</where>
</select>
<select id="selectCoscoSupplierexitSupplierCategoryList" parameterType="com.chinaunicom.zyhy.ebtp.supplier.coscosupplier.entity.CoscoSupplierexitSupplierCategory" resultMap="CoscoSupplierexitSupplierCategoryResult">
<include refid="selectCoscoSupplierexitSupplierCategoryVo"/>
<where>
and sc.supplierexit_id = #{supplierexitId}
</where>
</select>
<select id="selectCoscoSupplierexitSupplierCategoryBySupplierexitId" parameterType="String"
resultMap="CoscoSupplierexitSupplierCategoryResult">
<include refid="selectCoscoSupplierexitSupplierCategoryVo"/>
where supplierexit_id = #{supplierexitId}
</select>
<insert id="insertCoscoSupplierexitSupplierCategory" parameterType="com.chinaunicom.zyhy.ebtp.supplier.coscosupplier.entity.CoscoSupplierexitSupplierCategory">
insert into cosco_supplierexit_supplier_category
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="supplierexitId != null">supplierexit_id,</if>
<if test="supplierId != null">supplier_id,</if>
<if test="categoryId != null">category_id,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="supplierexitId != null">#{supplierexitId},</if>
<if test="supplierId != null">#{supplierId},</if>
<if test="categoryId != null">#{categoryId},</if>
</trim>
</insert>
<insert id="batchCoscoSupplierexitSupplierCategory" parameterType="java.util.List">
insert into cosco_supplierexit_supplier_category
( supplierexit_id, supplier_id, category_id)
values
<foreach item="item" index="index" collection="list" separator=",">
( #{item.supplierexitId}, #{item.supplierId}, #{item.categoryId})
</foreach>
</insert>
<update id="updateCoscoSupplierexitSupplierCategory" parameterType="com.chinaunicom.zyhy.ebtp.supplier.coscosupplier.entity.CoscoSupplierexitSupplierCategory">
update cosco_supplierexit_supplier_category
<trim prefix="SET" suffixOverrides=",">
<if test="supplierId != null">supplier_id =
#{supplierId},
</if>
<if test="categoryId != null">category_id =
#{categoryId},
</if>
</trim>
where supplierexit_id = #{supplierexitId}
</update>
<update id="deleteCoscoSupplierexitSupplierCategoryBySupplierexitId" parameterType="String">
update cosco_supplierexit_supplier_category set del_flag = 2
where supplierexit_id = #{supplierexitId}
</update>
<update id="deleteCoscoSupplierexitSupplierCategoryBySupplierexitIds" parameterType="String">
update cosco_supplierexit_supplier_category set del_flag = 2 where supplierexit_id in
<foreach item="supplierexitId" collection="array" open="(" separator="," close=")">
#{supplierexitId}
</foreach>
</update>
</mapper>

View File

@ -0,0 +1,69 @@
<?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.chinaunicom.zyhy.ebtp.supplier.coscosupplier.dao.mapper.CoscoSupplierexitSupplierMapper">
<resultMap type="com.chinaunicom.zyhy.ebtp.supplier.coscosupplier.entity.CoscoSupplierexitSupplier" id="CoscoSupplierexitSupplierResult">
<result property="supplierexitId" column="supplierexit_id"/>
<result property="supplierId" column="supplier_id"/>
</resultMap>
<sql id="selectCoscoSupplierexitSupplierVo">
select supplierexit_id, supplier_id
from cosco_supplierexit_supplier
</sql>
<select id="selectCoscoSupplierexitSupplierList" parameterType="com.chinaunicom.zyhy.ebtp.supplier.coscosupplier.entity.CoscoSupplierexitSupplier" resultMap="CoscoSupplierexitSupplierResult">
<include refid="selectCoscoSupplierexitSupplierVo"/>
<where>
</where>
</select>
<select id="selectCoscoSupplierexitSupplierBySupplierexitId" parameterType="String"
resultMap="CoscoSupplierexitSupplierResult">
<include refid="selectCoscoSupplierexitSupplierVo"/>
where supplierexit_id = #{supplierexitId}
</select>
<insert id="insertCoscoSupplierexitSupplier" parameterType="com.chinaunicom.zyhy.ebtp.supplier.coscosupplier.entity.CoscoSupplierexitSupplier">
insert into cosco_supplierexit_supplier
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="supplierexitId != null">supplierexit_id,</if>
<if test="supplierId != null">supplier_id,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="supplierexitId != null">#{supplierexitId},</if>
<if test="supplierId != null">#{supplierId},</if>
</trim>
</insert>
<insert id="batchCoscoSupplierexitSupplier" parameterType="java.util.List">
insert into cosco_supplierexit_supplier
( supplierexit_id, supplier_id)
values
<foreach item="item" index="index" collection="list" separator=",">
( #{item.supplierexitId}, #{item.supplierId})
</foreach>
</insert>
<update id="updateCoscoSupplierexitSupplier" parameterType="com.chinaunicom.zyhy.ebtp.supplier.coscosupplier.entity.CoscoSupplierexitSupplier">
update cosco_supplierexit_supplier
<trim prefix="SET" suffixOverrides=",">
<if test="supplierId != null">supplier_id =
#{supplierId},
</if>
</trim>
where supplierexit_id = #{supplierexitId}
</update>
<update id="deleteCoscoSupplierexitSupplierBySupplierexitId" parameterType="String">
update cosco_supplierexit_supplier set del_flag = 2
where supplierexit_id = #{supplierexitId}
</update>
<update id="deleteCoscoSupplierexitSupplierBySupplierexitIds" parameterType="String">
update cosco_supplierexit_supplier set del_flag = 2 where supplierexit_id in
<foreach item="supplierexitId" collection="array" open="(" separator="," close=")">
#{supplierexitId}
</foreach>
</update>
</mapper>