添加数据

This commit is contained in:
YY
2025-07-25 14:43:29 +08:00
parent 58975b9bf5
commit dffd5225f3
22 changed files with 545 additions and 246 deletions

View File

@ -16,6 +16,9 @@
<result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/>
<result property="lastUpdateTime" column="last_update_time"/>
<result property="supplierName" column="supplier_name"/>
</resultMap>
<sql id="selectCoscoAnnualreviewTaskSupplierVo">
@ -68,8 +71,20 @@
<select id="selectByIds"
parameterType="list"
resultMap="CoscoAnnualreviewTaskSupplierResult">
<include refid="selectCoscoAnnualreviewTaskSupplierVo"/>
where annualreview_task_id in
select cats.id,
cats.annualreview_task_id,
cats.supplier_id,
cats.review_result,
cats.del_flag,
cats.create_by,
cats.create_time,
cats.update_by,
cats.update_time,
cats.last_update_time,
csb.name as supplier_name
from cosco_annualreview_task_supplier cats
left join cosco_supplier_base csb on csb.id = cats.supplier_id
where cats.annualreview_task_id in
<foreach item="item" collection="list" separator="," open="(" close=")">
#{item}
</foreach>

View File

@ -8,6 +8,7 @@
id="CoscoBlacklistSupplierResult">
<result property="blacklistId" column="blacklist_id"/>
<result property="supplierId" column="supplier_id"/>
<result property="supplierName" column="supplier_name"/>
</resultMap>
<sql id="selectCoscoBlacklistSupplierVo">
@ -18,9 +19,11 @@
<select id="selectCoscoBlacklistSupplierList"
parameterType="com.chinaunicom.zyhy.ebtp.supplier.coscoBlack.entity.CoscoBlacklistSupplier"
resultMap="CoscoBlacklistSupplierResult">
<include refid="selectCoscoBlacklistSupplierVo"/>
select cbs.blacklist_id, cbs.supplier_id, csb.name as supplier_name
from cosco_blacklist_supplier cbs
left join cosco_supplier_base csb on csb.id = cbs.supplier_id
<where>
blacklist_id = #{blacklistId}
cbs.blacklist_id = #{blacklistId}
</where>
</select>

View File

@ -4,45 +4,72 @@
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.chinaunicom.zyhy.ebtp.supplier.coscoCategory.dao.CoscoCategoryLibrarySupplierApplyMapper">
<resultMap type="com.chinaunicom.zyhy.ebtp.supplier.coscoCategory.entity.CoscoCategoryLibrarySupplierApply" id="CoscoCategoryLibrarySupplierApplyResult">
<result property="id" column="id"/>
<result property="categoryLibraryId" column="category_library_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 type="com.chinaunicom.zyhy.ebtp.supplier.coscoCategory.entity.CoscoCategoryLibrarySupplierApply"
id="CoscoCategoryLibrarySupplierApplyResult">
<result property="id" column="id"/>
<result property="categoryLibraryId" column="category_library_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"/>
<result property="deptId" column="dept_id"/>
<result property="libraryName" column="libraryName"/>
</resultMap>
<sql id="selectCoscoCategoryLibrarySupplierApplyVo">
select id, category_library_id, approve_status, work_flow_id, del_flag, create_by, create_time, update_by, update_time, last_update_time
select id,
category_library_id,
approve_status,
work_flow_id,
del_flag,
create_by,
create_time,
update_by,
update_time,
last_update_time
from cosco_category_library_supplier_apply
</sql>
<select id="selectCoscoCategoryLibrarySupplierApplyList" parameterType="com.chinaunicom.zyhy.ebtp.supplier.coscoCategory.entity.CoscoCategoryLibrarySupplierApply" resultMap="CoscoCategoryLibrarySupplierApplyResult">
<select id="selectCoscoCategoryLibrarySupplierApplyList"
parameterType="com.chinaunicom.zyhy.ebtp.supplier.coscoCategory.entity.CoscoCategoryLibrarySupplierApply"
resultMap="CoscoCategoryLibrarySupplierApplyResult">
<include refid="selectCoscoCategoryLibrarySupplierApplyVo"/>
<where>
<if test="categoryLibraryId != null and categoryLibraryId != ''">
and category_library_id = #{categoryLibraryId}
</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>
<if test="categoryLibraryId != null and categoryLibraryId != ''">
and category_library_id = #{categoryLibraryId}
</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="selectByWorkFlowId" resultMap="CoscoCategoryLibrarySupplierApplyResult" parameterType="string">
<include refid="selectCoscoCategoryLibrarySupplierApplyVo"></include>
where work_flow_id = #{workFlowId}
select cclsa.id,
cclsa.category_library_id,
cclsa.approve_status,
cclsa.work_flow_id,
cclsa.del_flag,
cclsa.create_by,
cclsa.create_time,
cclsa.update_by,
cclsa.update_time,
cclsa.last_update_time,
ccl.dept_id ,
ccl.name as libraryName
from cosco_category_library_supplier_apply cclsa
left join cosco_category_library ccl on cclsa.category_library_id = ccl.id
where cclsa.work_flow_id = #{workFlowId}
</select>
<select id="selectCoscoCategoryLibrarySupplierApplyById" parameterType="String"
@ -50,86 +77,91 @@
select cclsa.id,
ccl.name,
ccl.area,
ccl.id as libraryId,
'张三' as applyUser ,
ccl.create_time as applyTime,
ccl.id as libraryId,
'张三' as applyUser,
ccl.create_time as applyTime,
cclsa.approve_status as approveStatus
from cosco_category_library_supplier_apply cclsa
join cosco_category_library ccl on cclsa.category_library_id=ccl.id
where cclsa.id=#{id}
join cosco_category_library ccl on cclsa.category_library_id = ccl.id
where cclsa.id = #{id}
</select>
<insert id="insertCoscoCategoryLibrarySupplierApply" parameterType="com.chinaunicom.zyhy.ebtp.supplier.coscoCategory.entity.CoscoCategoryLibrarySupplierApply">
<insert id="insertCoscoCategoryLibrarySupplierApply"
parameterType="com.chinaunicom.zyhy.ebtp.supplier.coscoCategory.entity.CoscoCategoryLibrarySupplierApply">
insert into cosco_category_library_supplier_apply
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="categoryLibraryId != null">category_library_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>
<if test="id != null">id,</if>
<if test="categoryLibraryId != null">category_library_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="categoryLibraryId != null">#{categoryLibraryId},</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>
<if test="id != null">#{id},</if>
<if test="categoryLibraryId != null">#{categoryLibraryId},</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="batchCoscoCategoryLibrarySupplierApply" parameterType="java.util.List">
insert into cosco_category_library_supplier_apply
( id, category_library_id, approve_status, work_flow_id, del_flag, create_by, create_time, update_by, update_time, last_update_time)
( id, category_library_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.categoryLibraryId}, #{item.approveStatus}, #{item.workFlowId}, #{item.delFlag}, #{item.createBy}, #{item.createTime}, #{item.updateBy}, #{item.updateTime}, #{item.lastUpdateTime})
( #{item.id}, #{item.categoryLibraryId}, #{item.approveStatus}, #{item.workFlowId}, #{item.delFlag},
#{item.createBy}, #{item.createTime}, #{item.updateBy}, #{item.updateTime}, #{item.lastUpdateTime})
</foreach>
</insert>
<update id="updateCoscoCategoryLibrarySupplierApply" parameterType="com.chinaunicom.zyhy.ebtp.supplier.coscoCategory.entity.CoscoCategoryLibrarySupplierApply">
<update id="updateCoscoCategoryLibrarySupplierApply"
parameterType="com.chinaunicom.zyhy.ebtp.supplier.coscoCategory.entity.CoscoCategoryLibrarySupplierApply">
update cosco_category_library_supplier_apply
<trim prefix="SET" suffixOverrides=",">
<if test="categoryLibraryId != null">category_library_id =
#{categoryLibraryId},
</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>
<if test="categoryLibraryId != null">category_library_id =
#{categoryLibraryId},
</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="deleteCoscoCategoryLibrarySupplierApplyById" parameterType="String">
update cosco_category_library_supplier_apply set del_flag = 2
update cosco_category_library_supplier_apply
set del_flag = 2
where id = #{id}
</update>
@ -140,19 +172,23 @@
</foreach>
</update>
<select id="selectSupplierByLibraryId" parameterType="string" resultType="com.chinaunicom.zyhy.ebtp.supplier.coscoCategory.vo.CoscoCategoryLibrarySupplierVo">
select csb.name as name,
csb.enterprise_type as area,
<select id="selectSupplierByLibraryId" parameterType="string"
resultType="com.chinaunicom.zyhy.ebtp.supplier.coscoCategory.vo.CoscoCategoryLibrarySupplierVo">
select csb.name as name,
csb.enterprise_type as area,
csb.social_credit_code as unifiedSocialCreditCode,
csb.supplier_type as supplierCategory,
csb.supplier_type as supplierCategory,
csb.id
from cosco_category_library_supplier_apply cclsa
join cosco_category_library_supplier ccls on cclsa.id=ccls.category_library_supplier_apply_id
join cosco_supplier_base csb on ccls.supplier_id=csb.id
join cosco_category_library_supplier ccls on cclsa.id = ccls.category_library_supplier_apply_id
join cosco_supplier_base csb on ccls.supplier_id = csb.id
where cclsa.category_library_id = #{id} and cclsa.approve_status=1 and cclsa.del_flag ='normal'
where cclsa.category_library_id = #{id}
and cclsa.approve_status = 1
and cclsa.del_flag = 'normal'
</select>
<select id="selectCategorySupplier" parameterType="list" resultType="com.chinaunicom.zyhy.ebtp.supplier.coscoCategory.vo.CoscoCategoryLibrarySupplierVo">
<select id="selectCategorySupplier" parameterType="list"
resultType="com.chinaunicom.zyhy.ebtp.supplier.coscoCategory.vo.CoscoCategoryLibrarySupplierVo">
select csb.name as name,
csb.enterprise_type as area,
@ -160,8 +196,8 @@
csb.supplier_type as supplierCategory,
csb.id
from
cosco_supplier_base csb
left join cosco_access_supplier_category casc on csb.id=casc.supplier_id
cosco_supplier_base csb
left join cosco_access_supplier_category casc on csb.id=casc.supplier_id
where casc.del_flag='normal' and csb.del_flag='normal'
AND csb.id IN (
SELECT
@ -182,39 +218,40 @@
group by csb.id
</select>
<select id="selectPageList" resultType="com.chinaunicom.zyhy.ebtp.supplier.coscoCategory.vo.ListCoscoCategoryLibrarySupplierApplyVo">
<select id="selectPageList"
resultType="com.chinaunicom.zyhy.ebtp.supplier.coscoCategory.vo.ListCoscoCategoryLibrarySupplierApplyVo">
select cclsa.id, ccl.name,ccl.area AS area,cclsa.create_by as createBy ,
ccl.create_time as applyTime,cclsa.approve_status as approveStatus,ccl.dept_id as deptId,
case when cclsa.approve_status=0 and cclsa.work_flow_id is null then '未开始'
when cclsa.approve_status=0 and cclsa.work_flow_id is not null then '进行中'
else '已结束'
end as processStatusName,
case when cclsa.approve_status=1 then '通过'
when cclsa.approve_status=2 then '驳回'
end as approveResult,
CASE
WHEN COUNT(csb.id) = 0 THEN NULL
WHEN COUNT(csb.id) = 1 THEN MAX(csb.name)
ELSE CONCAT(MAX(csb.name), ' 等', COUNT(csb.id), '家公司')
END AS supplierName
ccl.create_time as applyTime,cclsa.approve_status as approveStatus,ccl.dept_id as deptId,
case when cclsa.approve_status=0 and cclsa.work_flow_id is null then '未开始'
when cclsa.approve_status=0 and cclsa.work_flow_id is not null then '进行中'
else '已结束'
end as processStatusName,
case when cclsa.approve_status=1 then '通过'
when cclsa.approve_status=2 then '驳回'
end as approveResult,
CASE
WHEN COUNT(csb.id) = 0 THEN NULL
WHEN COUNT(csb.id) = 1 THEN MAX(csb.name)
ELSE CONCAT(MAX(csb.name), ' 等', COUNT(csb.id), '家公司')
END AS supplierName
from cosco_category_library_supplier_apply cclsa
join cosco_category_library ccl on cclsa.category_library_id=ccl.id
left join cosco_category_library_supplier ccls on ccls.category_library_supplier_apply_id=cclsa.id
left join cosco_supplier_base csb on csb.id= ccls.supplier_id
join cosco_category_library ccl on cclsa.category_library_id=ccl.id
left join cosco_category_library_supplier ccls on ccls.category_library_supplier_apply_id=cclsa.id
left join cosco_supplier_base csb on csb.id= ccls.supplier_id
where cclsa.del_flag ='normal'
<if test="vo.name!=null and vo.name!=''">
and ccl.name like concat('%',#{vo.name},'%')
and ccl.name like concat('%',#{vo.name},'%')
</if>
<if test="vo.area!=null and vo.area!=''">
and ccl.area = #{vo.area}
and ccl.area = #{vo.area}
</if>
<if test="vo.approveStatus!=null and vo.approveStatus!=''">
and cclsa.approveStatus = #{vo.approveStatus}
and cclsa.approveStatus = #{vo.approveStatus}
</if>
GROUP BY
cclsa.id
cclsa.id
order by cclsa.create_time desc
</select>

View File

@ -10,6 +10,7 @@
<result property="categoryLibrarySupplierApplyId" column="category_library_supplier_apply_id"/>
<result property="categoryLibraryId" column="category_library_id"/>
<result property="supplierId" column="supplier_id"/>
<result property="supplierName" column="supplierName"/>
</resultMap>
<sql id="selectCoscoCategoryLibrarySupplierVo">
@ -20,7 +21,10 @@
<select id="selectCoscoCategoryLibrarySupplierList"
parameterType="com.chinaunicom.zyhy.ebtp.supplier.coscoCategory.entity.CoscoCategoryLibrarySupplier"
resultMap="CoscoCategoryLibrarySupplierResult">
<include refid="selectCoscoCategoryLibrarySupplierVo"/>
select ccls.id, ccls.category_library_supplier_apply_id, ccls.category_library_id, ccls.supplier_id,
csb.name as supplierName
from cosco_category_library_supplier ccls
left join cosco_supplier_base csb on ccls.supplier_id = csb.id
<where>
<if test="categoryLibrarySupplierApplyId != null and categoryLibrarySupplierApplyId != ''">
and category_library_supplier_apply_id = #{categoryLibrarySupplierApplyId}
@ -101,7 +105,10 @@
<select id="selectSupplierByApplyId" parameterType="string"
resultType="com.chinaunicom.zyhy.ebtp.supplier.coscoCategory.vo.CoscoCategoryLibrarySupplierVo">
select csb.name, csb.enterprise_type area, csb.supplier_type supplierCategory, csb.id ,
select csb.name,
csb.enterprise_type area,
csb.supplier_type supplierCategory,
csb.id,
csb.social_credit_code unifiedSocialCreditCode
from cosco_category_library_supplier ccls
join cosco_supplier_base csb on ccls.supplier_id = csb.id