删除品类mapper

This commit is contained in:
YY
2025-07-24 08:46:08 +08:00
parent 6cc41f3bfb
commit f3343871f3
5 changed files with 4 additions and 530 deletions

View File

@ -1,235 +0,0 @@
<?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.coscoCategory.dao.CoscoCategoryMapper">
<resultMap type="com.chinaunicom.zyhy.ebtp.supplier.coscoCategory.entity.CoscoCategory" id="CoscoCategoryResult">
<result property="id" column="id"/>
<result property="categoryName" column="category_name"/>
<result property="parentId" column="parent_id"/>
<result property="type" column="type"/>
<result property="orderBy" column="order_by"/>
<result property="ancestors" column="ancestors"/>
<result property="remark" column="remark"/>
<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="selectCoscoCategoryVo">
select id,
category_name,
parent_id,
type,
order_by,
ancestors,
remark,
del_flag,
create_by,
create_time,
update_by,
update_time,
last_update_time
from cosco_category
</sql>
<select id="selectCoscoCategoryList"
parameterType="com.chinaunicom.zyhy.ebtp.supplier.coscoCategory.entity.CoscoCategory"
resultMap="CoscoCategoryResult">
select cc.id,
cc.category_name,
cc.parent_id,
cc.type,
cc.order_by,
cc.ancestors,
cc.remark,
cc.del_flag,
cc.create_by,
cc.create_time,
cc.update_by,
cc.update_time,
cc.last_update_time
from cosco_category cc
<where>
and cc.del_flag = 'normal'
<if test="categoryName != null and categoryName != ''">
and cc.category_name like concat('%', #{categoryName}, '%')
</if>
<if test="parentId != null and parentId != ''">
and cc.parent_id = #{parentId}
</if>
<if test="type != null ">
and cc.type = #{type}
</if>
<if test="orderBy != null ">
and cc.order_by = #{orderBy}
</if>
<if test="lastUpdateTime != null ">
and cc.last_update_time = #{lastUpdateTime}
</if>
<if test="deptIds!=null and deptIds.size>0">
and cc.id not in (
SELECT
cclc.category_id
FROM
cosco_category_library ccl
JOIN cosco_category_library_contain cclc on ccl.id=cclc.category_library_id
where ccl.dept_id in (
<foreach item="deptId" index="index" collection="deptIds" separator=",">
#{deptId}
</foreach>
) and ccl.approve_status=1 and cclc.lock_type=1
)
</if>
</where>
order by cc.order_by asc
</select>
<select id="selectMyPage" parameterType="object"
resultMap="CoscoCategoryResult">
<include refid="selectCoscoCategoryVo"/>
order by order_by asc
</select>
<select id="selectCoscoCategoryById" parameterType="String"
resultMap="CoscoCategoryResult">
<include refid="selectCoscoCategoryVo"/>
where id = #{id}
</select>
<select id="selectCategoryNameById" parameterType="string" resultType="string">
SELECT COALESCE((SELECT GROUP_CONCAT(category_name ORDER BY FIND_IN_SET(id, c.ancestors) SEPARATOR '-')
FROM cosco_category
WHERE FIND_IN_SET(id, c.ancestors)), '') AS ancestor_names
FROM cosco_category c
WHERE id = #{id}
</select>
<select id="selectCoscoCategoryNameList"
parameterType="com.chinaunicom.zyhy.ebtp.supplier.coscoCategory.entity.CoscoCategory"
resultMap="CoscoCategoryResult">
SELECT
c.id,
(
SELECT GROUP_CONCAT(p.category_name ORDER BY FIND_IN_SET(p.id, c.ancestors) SEPARATOR '-')
FROM cosco_category p
WHERE FIND_IN_SET(p.id, c.ancestors)
) AS categoryName
FROM cosco_category c
WHERE c.id IN
<foreach collection="idList" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</select>
<insert id="insertCoscoCategory"
parameterType="com.chinaunicom.zyhy.ebtp.supplier.coscoCategory.entity.CoscoCategory">
insert into cosco_category
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="categoryName != null and categoryName != ''">category_name,</if>
<if test="parentId != null">parent_id,</if>
<if test="type != null">type,</if>
<if test="orderBy != null">order_by,</if>
<if test="ancestors != null">ancestors,</if>
<if test="remark != null">remark,</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="categoryName != null and categoryName != ''">#{categoryName},</if>
<if test="parentId != null">#{parentId},</if>
<if test="type != null">#{type},</if>
<if test="orderBy != null">#{orderBy},</if>
<if test="ancestors != null">#{ancestors},</if>
<if test="remark != null">#{remark},</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="batchCoscoCategory" parameterType="java.util.List">
insert into cosco_category
( id, category_name, parent_id, type, order_by, ancestors, remark, 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.categoryName}, #{item.parentId}, #{item.type}, #{item.orderBy}, #{item.ancestors},
#{item.remark}, #{item.delFlag}, #{item.createBy}, #{item.createTime}, #{item.updateBy}, #{item.updateTime},
#{item.lastUpdateTime})
</foreach>
</insert>
<update id="updateCoscoCategory"
parameterType="com.chinaunicom.zyhy.ebtp.supplier.coscoCategory.entity.CoscoCategory">
update cosco_category
<trim prefix="SET" suffixOverrides=",">
<if test="categoryName != null and categoryName != ''">category_name =
#{categoryName},
</if>
<if test="parentId != null">parent_id =
#{parentId},
</if>
<if test="type != null">type =
#{type},
</if>
<if test="orderBy != null">order_by =
#{orderBy},
</if>
<if test="ancestors != null">ancestors =
#{ancestors},
</if>
<if test="remark != null">remark =
#{remark},
</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="deleteCoscoCategoryById" parameterType="String">
update cosco_category
set del_flag = 'deleted'
where id = #{id}
</update>
<update id="deleteCoscoCategoryByIds" parameterType="String">
update cosco_category set del_flag = 'deleted' where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</update>
</mapper>