Merge branch 'dev' of http://10.0.0.126:8500/liushimin/biz_supplier_manage into newBug
Conflicts: src/main/java/com/chinaunicom/zyhy/ebtp/supplier/config/SecurityConfig.java src/main/java/com/chinaunicom/zyhy/ebtp/supplier/coscosupplier/service/impl/CoscoSupplierBaseServiceImpl.java
This commit is contained in:
@ -21,6 +21,24 @@
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectCoscoAccessCategoryByDeptIdList" parameterType="com.chinaunicom.zyhy.ebtp.supplier.coscosupplier.entity.CoscoAccessCategory" resultMap="CoscoAccessCategoryResult">
|
||||
SELECT
|
||||
cac.category_id,
|
||||
cas.supplier_id,
|
||||
cc.category_name as categoryName,
|
||||
CASE
|
||||
WHEN csb.supplier_type = 'ovs' THEN
|
||||
name_en ELSE name
|
||||
END AS supplierName
|
||||
from cosco_access_work caw
|
||||
left join cosco_access_category cac on caw.id = cac.access_work_id
|
||||
left join cosco_category cc on cc.id = cac.category_id and cc.del_flag = 'normal'
|
||||
left join cosco_access_supplier cas on caw.id = cas.access_work_id
|
||||
LEFT JOIN cosco_supplier_base csb ON cas.supplier_id = csb.id and csb.del_flag = 'normal'
|
||||
LEFT JOIN cosco_access_supplier_category casc ON casc.category_id = cac.category_id AND casc.dept_id = #{deptId} and cas.supplier_id = casc.supplier_id and casc.del_flag = 'normal'
|
||||
where caw.id = #{accessWorkId} AND casc.id IS NULL;
|
||||
</select>
|
||||
|
||||
<select id="selectCoscoAccessCategoryByAccessWorkId" parameterType="String"
|
||||
resultMap="CoscoAccessCategoryResult">
|
||||
<include refid="selectCoscoAccessCategoryVo"/>
|
||||
|
@ -151,13 +151,13 @@
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<update id="deleteCoscoAccessItemAttachmentsById" parameterType="String">
|
||||
update cosco_access_item_attachments set del_flag = 2
|
||||
where id = #{id}
|
||||
<update id="deleteCoscoAccessItemAttachmentsByAccessUserItemId" parameterType="String">
|
||||
update cosco_access_item_attachments set del_flag = 'deleted'
|
||||
where access_user_item_id = #{accessUserItemId}
|
||||
</update>
|
||||
|
||||
<update id="deleteCoscoAccessItemAttachmentsByIds" parameterType="String">
|
||||
update cosco_access_item_attachments set del_flag = 2 where id in
|
||||
update cosco_access_item_attachments set del_flag = 'deleted' where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
|
@ -44,6 +44,14 @@
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectGroupByItemList" parameterType="com.chinaunicom.zyhy.ebtp.supplier.coscosupplier.entity.CoscoAccessItem" resultMap="CoscoAccessItemResult">
|
||||
select item_type,item_name
|
||||
from cosco_access_item
|
||||
where access_work_id = #{accessWorkId}
|
||||
GROUP BY item_type,item_name
|
||||
|
||||
</select>
|
||||
|
||||
<select id="selectCoscoAccessItemById" parameterType="String"
|
||||
resultMap="CoscoAccessItemResult">
|
||||
<include refid="selectCoscoAccessItemVo"/>
|
||||
|
@ -176,6 +176,7 @@
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
order by c.create_time desc
|
||||
</select>
|
||||
|
||||
|
||||
|
@ -9,6 +9,26 @@
|
||||
<result property="supplierId" column="supplier_id"/>
|
||||
<result property="deptId" column="dept_id"/>
|
||||
<result property="supplierexitId" column="supplierexit_id"/>
|
||||
<collection property="categoryNameList"
|
||||
column="{supplierId=supplier_id}"
|
||||
ofType="string"
|
||||
select="selectCoscoAccessCategoryList">
|
||||
</collection>
|
||||
</resultMap>
|
||||
|
||||
|
||||
<resultMap type="com.chinaunicom.zyhy.ebtp.supplier.coscosupplier.entity.CoscoAccessSupplierCategory" id="CoscoAccessSupplierCategoryResult">
|
||||
<result property="id" column="id"/>
|
||||
<result property="accessWorkId" column="access_work_id"/>
|
||||
<result property="supplierId" column="supplier_id"/>
|
||||
<result property="categoryId" column="category_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"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectCoscoAccessSupplierVo">
|
||||
@ -20,9 +40,45 @@
|
||||
a.dept_id
|
||||
FROM
|
||||
cosco_access_supplier a
|
||||
LEFT JOIN cosco_supplier_base s ON a.supplier_id = s.id
|
||||
LEFT JOIN cosco_supplier_base s ON a.supplier_id = s.id and s.del_flag = 'normal'
|
||||
</sql>
|
||||
|
||||
<sql id="selectCoscoAccessSupplierAndWorkVo">
|
||||
SELECT
|
||||
a.id,
|
||||
CASE
|
||||
WHEN s.supplier_type = 'ovs' THEN
|
||||
name_en ELSE name END AS supplierName,
|
||||
CASE s.supplier_type
|
||||
WHEN 'dvs' THEN '境内企业'
|
||||
WHEN 'ovs' THEN '境外企业'
|
||||
WHEN 'pe' THEN '个人'
|
||||
END AS supplier_type_cn,
|
||||
a.access_work_id,
|
||||
a.supplier_id,
|
||||
a.dept_id,
|
||||
caw.access_type,
|
||||
CASE
|
||||
WHEN caw.access_type = 'online' THEN '线上准入'
|
||||
WHEN caw.access_type = 'offline' THEN '线下准入'
|
||||
WHEN caw.access_type = 'scattered' THEN '零星采购/应急采购/个人供应商'
|
||||
ELSE caw.access_type
|
||||
END AS accessTypeText,
|
||||
YEAR(caw.update_time) AS updateYear
|
||||
FROM
|
||||
cosco_access_supplier a
|
||||
LEFT JOIN cosco_supplier_base s ON a.supplier_id = s.id and s.del_flag = 'normal'
|
||||
left join cosco_access_work caw on caw.id = a.access_work_id and caw.del_flag = 'normal'
|
||||
</sql>
|
||||
|
||||
<select id="selectCoscoAccessCategoryList"
|
||||
parameterType="map"
|
||||
resultType="string">
|
||||
select a.category_name as categoryName from cosco_access_supplier_category c
|
||||
left join cosco_category a on c.category_id = a.id and a.del_flag = 'normal'
|
||||
where c.supplier_id = #{supplierId} and c.del_flag = 'normal'
|
||||
</select>
|
||||
|
||||
<select id="selectCoscoAccessSupplierList" parameterType="com.chinaunicom.zyhy.ebtp.supplier.coscosupplier.entity.CoscoAccessSupplier" resultMap="CoscoAccessSupplierResult">
|
||||
<include refid="selectCoscoAccessSupplierVo"/>
|
||||
<where>
|
||||
@ -38,22 +94,60 @@
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
<select id="selectSupplierIdByDeptIdList" parameterType="java.util.List" resultType="String">
|
||||
SELECT
|
||||
cas.supplier_id
|
||||
FROM
|
||||
cosco_access_work caw
|
||||
LEFT JOIN cosco_access_supplier cas ON caw.id = cas.access_work_id
|
||||
WHERE (caw.approve_status IS NULL OR caw.approve_status = 0 or (caw.approve_status = 1 and cas.access_status = 1))
|
||||
AND cas.dept_id in (
|
||||
<foreach item="item" index="index" collection="list" separator=",">
|
||||
#{item}
|
||||
<select id="selectCoscoAccessSupplierAndWorkPageList" parameterType="com.chinaunicom.zyhy.ebtp.supplier.coscosupplier.entity.CoscoAccessSupplier" resultMap="CoscoAccessSupplierResult">
|
||||
<include refid="selectCoscoAccessSupplierAndWorkVo"/>
|
||||
<where>
|
||||
and a.dept_id in
|
||||
<foreach collection="vo.deptIdList" item="item" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
)
|
||||
<if test="vo.accessStatus != null">
|
||||
and a.access_status = #{vo.accessStatus}
|
||||
</if>
|
||||
<if test="vo.supplierName != null and vo.supplierName != ''">
|
||||
and s.name = #{vo.supplierName} or s.name_en = #{vo.supplierName}
|
||||
</if>
|
||||
<if test="vo.accessType != null and vo.accessType != ''">
|
||||
and caw.access_type = #{vo.accessType}
|
||||
</if>
|
||||
<if test="vo.startTime!=null and vo.startTime != ''">
|
||||
and caw.update_time >= #{vo.startTime}
|
||||
</if>
|
||||
<if test="vo.endTime!=null and vo.endTime != ''">
|
||||
and caw.update_time < #{vo.endTime}
|
||||
</if>
|
||||
</where>
|
||||
order by a.id desc
|
||||
</select>
|
||||
|
||||
<select id="selectCoscoAccessSupplierAndWorkExecList" parameterType="com.chinaunicom.zyhy.ebtp.supplier.coscosupplier.entity.CoscoAccessSupplier" resultMap="CoscoAccessSupplierResult">
|
||||
<include refid="selectCoscoAccessSupplierAndWorkVo"/>
|
||||
<where>
|
||||
and a.dept_id in
|
||||
<foreach collection="deptIdList" item="item" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
<if test="accessStatus != null">
|
||||
and a.access_status = #{accessStatus}
|
||||
</if>
|
||||
<if test="supplierName != null and supplierName != ''">
|
||||
and s.name = #{supplierName} or s.name_en = #{supplierName}
|
||||
</if>
|
||||
<if test="accessType != null and accessType != ''">
|
||||
and caw.access_type = #{accessType}
|
||||
</if>
|
||||
<if test="startTime!=null and startTime != ''">
|
||||
and caw.update_time >= #{startTime}
|
||||
</if>
|
||||
<if test="endTime!=null and endTime != ''">
|
||||
and caw.update_time < #{endTime}
|
||||
</if>
|
||||
</where>
|
||||
order by a.id desc
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -45,6 +45,7 @@
|
||||
<sql id="selectCoscoAccessUserItemVo">
|
||||
SELECT
|
||||
i.item_name AS itemName,
|
||||
i.item_type as itemType,
|
||||
ui.review_by,
|
||||
ui.id,
|
||||
ui.access_work_id,
|
||||
|
@ -62,6 +62,14 @@
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectCoscoAccessWorkAttachmentsByWorkId" parameterType="String"
|
||||
resultMap="CoscoAccessWorkAttachmentsResult">
|
||||
<include refid="selectCoscoAccessWorkAttachmentsVo"/>
|
||||
where access_work_id = #{accessWorkId}
|
||||
</select>
|
||||
|
||||
|
||||
<insert id="insertCoscoAccessWorkAttachments" parameterType="com.chinaunicom.zyhy.ebtp.supplier.coscosupplier.entity.CoscoAccessWorkAttachments">
|
||||
insert into cosco_access_work_attachments
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
|
@ -10,6 +10,7 @@
|
||||
<result property="deptId" column="dept_id"/>
|
||||
<result property="applyType" column="apply_type"/>
|
||||
<result property="accessType" column="access_type"/>
|
||||
<result property="accessDesc" column="access_desc"/>
|
||||
<result property="startTime" column="start_time"/>
|
||||
<result property="endTime" column="end_time"/>
|
||||
<result property="reviewStatus" column="review_status"/>
|
||||
@ -21,19 +22,32 @@
|
||||
<result property="updateBy" column="update_by"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
<result property="lastUpdateTime" column="last_update_time"/>
|
||||
<collection property="categoryNameList"
|
||||
column="{accessWorkId=id}"
|
||||
ofType="string"
|
||||
select="selectCoscoAccessCategoryList">
|
||||
</collection>
|
||||
|
||||
</resultMap>
|
||||
|
||||
<resultMap type="com.chinaunicom.zyhy.ebtp.supplier.coscosupplier.entity.CoscoAccessCategory" id="CoscoAccessCategoryResult">
|
||||
<result property="accessWorkId" column="access_work_id"/>
|
||||
<result property="categoryId" column="category_id"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectCoscoAccessWorkVo">
|
||||
SELECT
|
||||
DISTINCT
|
||||
w.id,
|
||||
w.access_work_name,
|
||||
w.dept_id,
|
||||
w.access_type,
|
||||
CASE
|
||||
WHEN w.access_type = 'online' THEN '线上准入'
|
||||
WHEN w.access_type = 'offline' THEN '线下准入'
|
||||
WHEN w.access_type = 'scattered' THEN '零星采购/应急采购/个人供应商'
|
||||
ELSE w.access_type
|
||||
END AS access_type_text,
|
||||
w.access_desc,
|
||||
w.start_time,
|
||||
w.end_time,
|
||||
CASE
|
||||
@ -58,20 +72,21 @@
|
||||
w.last_update_time
|
||||
FROM
|
||||
cosco_access_work w
|
||||
left join cosco_access_category c on w.id = c.access_work_id
|
||||
</sql>
|
||||
|
||||
|
||||
|
||||
<sql id="selectCoscoAccessWorkGroupVo">
|
||||
select c.categoryName,
|
||||
select
|
||||
IFNULL(cau.is_leader, 0) AS isLeader,
|
||||
w.id,
|
||||
w.access_work_name,
|
||||
w.dept_id,
|
||||
w.access_type,
|
||||
CASE
|
||||
WHEN w.access_type = 'online' THEN '线上准入'
|
||||
WHEN w.access_type = 'offline' THEN '线下准入'
|
||||
WHEN w.access_type = 'scattered' THEN '零星采购/应急采购/个人供应商'
|
||||
ELSE w.access_type
|
||||
END AS access_type_text,
|
||||
w.start_time,
|
||||
@ -99,75 +114,26 @@
|
||||
w.last_update_time
|
||||
FROM
|
||||
cosco_access_work w
|
||||
left join (
|
||||
SELECT
|
||||
cac.access_work_id,
|
||||
GROUP_CONCAT(cc.category_name SEPARATOR ', ') AS categoryName
|
||||
FROM cosco_access_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 = w.id
|
||||
left join cosco_access_user cau on w.id = cau.access_work_id and cau.is_leader = 1
|
||||
left join cosco_access_user cau on w.id = cau.access_work_id and cau.is_leader = 1
|
||||
left join cosco_access_category cac on cac.access_work_id = w.id
|
||||
<if test="vo.userId != null and vo.userId != ''">
|
||||
and cau.user_id = #{vo.userId}
|
||||
</if>
|
||||
</sql>
|
||||
|
||||
|
||||
<select id="selectPageByIdList" parameterType="com.chinaunicom.zyhy.ebtp.supplier.coscosupplier.entity.CoscoAccessWork" resultType="long">
|
||||
select w.id from cosco_access_work w
|
||||
<where>
|
||||
and w.del_flag = 'normal'
|
||||
<if test="vo.categoryId != null and vo.categoryId != ''">
|
||||
and c.category_id = #{vo.categoryId}
|
||||
</if>
|
||||
<if test="vo.accessWorkName != null and vo.accessWorkName != ''">
|
||||
and w.access_work_name like concat('%', #{vo.accessWorkName}, '%')
|
||||
</if>
|
||||
<if test="vo.deptId != null and vo.deptId != ''">
|
||||
and w.dept_id = #{vo.deptId}
|
||||
</if>
|
||||
<if test="vo.applyType != null and vo.applyType != ''">
|
||||
and w.apply_type = #{vo.applyType}
|
||||
</if>
|
||||
<if test="vo.accessType != null and vo.accessType != ''">
|
||||
and w.access_type = #{vo.accessType}
|
||||
</if>
|
||||
<if test="vo.startTime != null ">
|
||||
and w.start_time = #{vo.startTime}
|
||||
</if>
|
||||
<if test="vo.endTime != null ">
|
||||
and w.end_time = #{vo.endTime}
|
||||
</if>
|
||||
<if test="vo.reviewStatus != null ">
|
||||
and w.review_status = #{vo.reviewStatus}
|
||||
</if>
|
||||
<if test="vo.approveStatus != null ">
|
||||
and w.approve_status = #{vo.approveStatus}
|
||||
</if>
|
||||
<if test="vo.workFlowId != null and vo.workFlowId != ''">
|
||||
and w.work_flow_id = #{vo.workFlowId}
|
||||
</if>
|
||||
<if test="vo.lastUpdateTime != null ">
|
||||
and w.last_update_time = #{vo.lastUpdateTime}
|
||||
</if>
|
||||
</where>
|
||||
order by w.create_time desc
|
||||
<select id="selectCoscoAccessCategoryList"
|
||||
parameterType="map"
|
||||
resultType="string">
|
||||
select a.category_name as categoryName from cosco_access_category c
|
||||
left join cosco_category a on c.category_id = a.id and a.del_flag = 'normal'
|
||||
where c.access_work_id = #{accessWorkId}
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectPageList" parameterType="com.chinaunicom.zyhy.ebtp.supplier.coscosupplier.entity.CoscoAccessWork" resultMap="CoscoAccessWorkResult">
|
||||
<include refid="selectCoscoAccessWorkGroupVo"/>
|
||||
<where>
|
||||
and w.del_flag = 'normal'
|
||||
<if test="vo.idList != null and vo.idList.size() > 0">
|
||||
AND w.id IN
|
||||
<foreach collection="vo.idList" item="item" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="vo.categoryId != null and vo.categoryId != ''">
|
||||
and c.category_id = #{vo.categoryId}
|
||||
and cac.category_id = #{vo.categoryId}
|
||||
</if>
|
||||
<if test="vo.accessWorkName != null and vo.accessWorkName != ''">
|
||||
and w.access_work_name like concat('%', #{vo.accessWorkName}, '%')
|
||||
@ -209,7 +175,7 @@
|
||||
<where>
|
||||
and w.del_flag = 'normal'
|
||||
<if test="vo.categoryId != null and vo.categoryId != ''">
|
||||
and c.category_id = #{vo.categoryId}
|
||||
and cac.category_id = #{vo.categoryId}
|
||||
</if>
|
||||
<if test="vo.accessWorkName != null and vo.accessWorkName != ''">
|
||||
and w.access_work_name like concat('%', #{vo.accessWorkName}, '%')
|
||||
@ -242,7 +208,6 @@
|
||||
and w.last_update_time = #{vo.lastUpdateTime}
|
||||
</if>
|
||||
</where>
|
||||
|
||||
order by w.create_time desc
|
||||
</select>
|
||||
|
||||
@ -253,7 +218,7 @@
|
||||
<where>
|
||||
and w.del_flag = 'normal'
|
||||
<if test="vo.categoryId != null and vo.categoryId != ''">
|
||||
and c.category_id = #{vo.categoryId}
|
||||
and cac.category_id = #{vo.categoryId}
|
||||
</if>
|
||||
<if test="vo.accessWorkName != null and vo.accessWorkName != ''">
|
||||
and w.access_work_name like concat('%', #{vo.accessWorkName}, '%')
|
||||
@ -289,7 +254,6 @@
|
||||
and w.last_update_time = #{vo.lastUpdateTime}
|
||||
</if>
|
||||
</where>
|
||||
|
||||
order by w.create_time desc
|
||||
</select>
|
||||
|
||||
@ -308,6 +272,7 @@
|
||||
<if test="deptId != null">dept_id,</if>
|
||||
<if test="applyType != null">apply_type,</if>
|
||||
<if test="accessType != null">access_type,</if>
|
||||
<if test="accessDesc != null">access_desc,</if>
|
||||
<if test="startTime != null">start_time,</if>
|
||||
<if test="endTime != null">end_time,</if>
|
||||
<if test="reviewStatus != null">review_status,</if>
|
||||
@ -326,6 +291,7 @@
|
||||
<if test="deptId != null">#{deptId},</if>
|
||||
<if test="applyType != null">#{applyType},</if>
|
||||
<if test="accessType != null">#{accessType},</if>
|
||||
<if test="accessDesc != null">#{accessDesc},</if>
|
||||
<if test="startTime != null">#{startTime},</if>
|
||||
<if test="endTime != null">#{endTime},</if>
|
||||
<if test="reviewStatus != null">#{reviewStatus},</if>
|
||||
@ -341,10 +307,10 @@
|
||||
</insert>
|
||||
<insert id="batchCoscoAccessWork" parameterType="java.util.List">
|
||||
insert into cosco_access_work
|
||||
( id, access_work_name, dept_id, apply_type, access_type, start_time, end_time, review_status, approve_status, work_flow_id, del_flag, create_by, create_time, update_by, update_time, last_update_time)
|
||||
( id, access_work_name, dept_id, apply_type, access_type, access_desc, start_time, end_time, review_status, 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.accessWorkName}, #{item.deptId}, #{item.applyType}, #{item.accessType}, #{item.startTime}, #{item.endTime}, #{item.reviewStatus}, #{item.approveStatus}, #{item.workFlowId}, #{item.delFlag}, #{item.createBy}, #{item.createTime}, #{item.updateBy}, #{item.updateTime}, #{item.lastUpdateTime})
|
||||
( #{item.id}, #{item.accessWorkName}, #{item.deptId}, #{item.applyType}, #{item.accessType}, #{item.accessDesc}, #{item.startTime}, #{item.endTime}, #{item.reviewStatus}, #{item.approveStatus}, #{item.workFlowId}, #{item.delFlag}, #{item.createBy}, #{item.createTime}, #{item.updateBy}, #{item.updateTime}, #{item.lastUpdateTime})
|
||||
</foreach>
|
||||
</insert>
|
||||
<update id="updateCoscoAccessWork" parameterType="com.chinaunicom.zyhy.ebtp.supplier.coscosupplier.entity.CoscoAccessWork">
|
||||
@ -362,6 +328,9 @@
|
||||
<if test="accessType != null">access_type =
|
||||
#{accessType},
|
||||
</if>
|
||||
<if test="accessDesc != null">access_desc =
|
||||
#{accessDesc},
|
||||
</if>
|
||||
<if test="startTime != null">start_time =
|
||||
#{startTime},
|
||||
</if>
|
||||
|
@ -51,6 +51,9 @@
|
||||
<result property="enterpriseTypeCn" column="enterprise_type_cn"/>
|
||||
<result property="currencyCn" column="currency_cn"/>
|
||||
<result property="deptId" column="dept_id"/>
|
||||
<result property="unifiedCode" column="unified_code"/>
|
||||
|
||||
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectCoscoSupplierBaseVo">
|
||||
@ -64,6 +67,12 @@
|
||||
WHEN 'pe' THEN '个人'
|
||||
ELSE supplier_type
|
||||
END AS supplier_type_cn,
|
||||
CASE
|
||||
WHEN supplier_type = 'dvs' THEN social_credit_code
|
||||
WHEN supplier_type = 'ovs' THEN vat
|
||||
WHEN supplier_type = 'pe' THEN id_card
|
||||
ELSE NULL
|
||||
END AS unified_code,
|
||||
licence_accessory,
|
||||
licence_date,
|
||||
enterprise_type,
|
||||
@ -139,6 +148,12 @@
|
||||
WHEN 'ovs' THEN '境外企业'
|
||||
WHEN 'pe' THEN '个人'
|
||||
END AS supplier_type_cn,
|
||||
CASE
|
||||
WHEN supplier_type = 'dvs' THEN social_credit_code
|
||||
WHEN supplier_type = 'ovs' THEN vat
|
||||
WHEN supplier_type = 'pe' THEN id_card
|
||||
ELSE NULL
|
||||
END AS unified_code,
|
||||
csb.enterprise_type,
|
||||
dp.dic_name as enterprise_type_cn,
|
||||
cas.id,
|
||||
@ -167,121 +182,49 @@
|
||||
left join dict_project dp on csb.enterprise_type = dp.`code` and dp.parent_code = 'enterprise_type'
|
||||
</sql>
|
||||
|
||||
|
||||
<sql id="selecWzrListVo">
|
||||
SELECT
|
||||
csb.id,
|
||||
CASE
|
||||
WHEN csb.supplier_type = 'dvs' THEN social_credit_code
|
||||
WHEN csb.supplier_type = 'ovs' THEN vat
|
||||
WHEN csb.supplier_type = 'pe' THEN id_card
|
||||
ELSE NULL
|
||||
END AS unified_code,
|
||||
CASE
|
||||
WHEN csb.supplier_type = 'ovs' THEN name_en
|
||||
ELSE name
|
||||
END AS name
|
||||
FROM
|
||||
cosco_supplier_base csb
|
||||
left join (
|
||||
SELECT
|
||||
cas.supplier_id
|
||||
FROM
|
||||
cosco_access_work caw
|
||||
LEFT JOIN cosco_access_supplier cas ON caw.id = cas.access_work_id
|
||||
WHERE
|
||||
(
|
||||
caw.approve_status IS NULL
|
||||
OR caw.approve_status = 0
|
||||
OR ( caw.approve_status = 1 AND cas.access_status = 1 ))
|
||||
AND cas.dept_id in
|
||||
<foreach item="item" collection="vo.deptIdList" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
) b on csb.id = b.supplier_id
|
||||
</sql>
|
||||
|
||||
<select id="selectWzrPageList" parameterType="com.chinaunicom.zyhy.ebtp.supplier.coscosupplier.entity.CoscoSupplierBase" resultMap="CoscoSupplierBaseResult">
|
||||
<include refid="selectCoscoSupplierBaseVo"/>
|
||||
<where>
|
||||
<if test="vo.supplierBaseList != null and vo.supplierBaseList.size() > 0">
|
||||
AND csb.id NOT IN
|
||||
<foreach collection="vo.supplierBaseList" item="item" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="vo.supplierType != null and vo.supplierType != ''">
|
||||
and supplier_type = #{vo.supplierType}
|
||||
</if>
|
||||
<if test="vo.licenceAccessory != null and vo.licenceAccessory != ''">
|
||||
and licence_accessory = #{vo.licenceAccessory}
|
||||
</if>
|
||||
<if test="vo.licenceDate != null and vo.licenceDate != ''">
|
||||
and licence_date = #{vo.licenceDate}
|
||||
</if>
|
||||
<if test="vo.enterpriseType != null and vo.enterpriseType != ''">
|
||||
and enterprise_type = #{vo.enterpriseType}
|
||||
</if>
|
||||
<if test="vo.name != null and vo.name != ''">
|
||||
and name like concat('%', #{vo.name}, '%')
|
||||
</if>
|
||||
<if test="vo.nameEn != null and vo.nameEn != ''">
|
||||
and name_en = #{vo.nameEn}
|
||||
</if>
|
||||
<if test="vo.socialCreditCode != null and vo.socialCreditCode != ''">
|
||||
and social_credit_code = #{vo.socialCreditCode}
|
||||
</if>
|
||||
<if test="vo.range != null and vo.range != ''">
|
||||
and `range` = #{vo.range}
|
||||
</if>
|
||||
<if test="vo.regAddress != null and vo.regAddress != ''">
|
||||
and reg_address = #{vo.regAddress}
|
||||
</if>
|
||||
<if test="vo.workAddress != null and vo.workAddress != ''">
|
||||
and work_address = #{vo.workAddress}
|
||||
</if>
|
||||
<if test="vo.parentCompanyInvestor != null and vo.parentCompanyInvestor != ''">
|
||||
and parent_company_investor = #{vo.parentCompanyInvestor}
|
||||
</if>
|
||||
<if test="vo.legalPerson != null and vo.legalPerson != ''">
|
||||
and legal_person = #{vo.legalPerson}
|
||||
</if>
|
||||
<if test="vo.idCard != null and vo.idCard != ''">
|
||||
and id_card = #{vo.idCard}
|
||||
</if>
|
||||
<if test="vo.capital != null ">
|
||||
and capital = #{vo.capital}
|
||||
</if>
|
||||
<if test="vo.contactsName != null and vo.contactsName != ''">
|
||||
and contacts_name like concat('%', #{vo.contactsName}, '%')
|
||||
</if>
|
||||
<if test="vo.contactsPhone != null and vo.contactsPhone != ''">
|
||||
and contacts_phone = #{vo.contactsPhone}
|
||||
</if>
|
||||
<if test="vo.contactsType != null and vo.contactsType != ''">
|
||||
and contacts_type = #{vo.contactsType}
|
||||
</if>
|
||||
<if test="vo.contactsEmail != null and vo.contactsEmail != ''">
|
||||
and contacts_email = #{vo.contactsEmail}
|
||||
</if>
|
||||
<if test="vo.telephone != null and vo.telephone != ''">
|
||||
and telephone = #{telephone}
|
||||
</if>
|
||||
<if test="vo.nation != null and vo.nation != ''">
|
||||
and nation = #{nation}
|
||||
</if>
|
||||
<if test="vo.vat != null and vo.vat != ''">
|
||||
and vat = #{vo.vat}
|
||||
</if>
|
||||
<if test="vo.taxpayerId != null and vo.taxpayerId != ''">
|
||||
and taxpayer_id = #{vo.taxpayerId}
|
||||
</if>
|
||||
<if test="vo.currency != null and vo.currency != ''">
|
||||
and currency = #{vo.currency}
|
||||
</if>
|
||||
<if test="vo.personName != null and vo.personName != ''">
|
||||
and person_name like concat('%', #{vo.personName}, '%')
|
||||
</if>
|
||||
<if test="vo.personPhone != null and vo.personPhone != ''">
|
||||
and person_phone = #{vo.personPhone}
|
||||
</if>
|
||||
<if test="vo.personBank != null and vo.personBank != ''">
|
||||
and person_bank = #{vo.personBank}
|
||||
</if>
|
||||
<if test="vo.personAccount != null and vo.personAccount != ''">
|
||||
and person_account = #{vo.personAccount}
|
||||
</if>
|
||||
<if test="vo.accessStatus != null ">
|
||||
and access_status = #{vo.accessStatus}
|
||||
</if>
|
||||
<if test="vo.blacklistStatus != null ">
|
||||
and blacklist_status = #{vo.blacklistStatus}
|
||||
</if>
|
||||
<if test="vo.greylistStatus != null ">
|
||||
and greylist_status = #{vo.greylistStatus}
|
||||
</if>
|
||||
<if test="vo.fillinStatus != null ">
|
||||
and fillin_status = #{vo.fillinStatus}
|
||||
</if>
|
||||
<if test="vo.fillinBy != null and vo.fillinBy != ''">
|
||||
and fillin_by = #{vo.fillinBy}
|
||||
</if>
|
||||
<if test="vo.sapCode != null and vo.sapCode != ''">
|
||||
and sap_code = #{vo.sapCode}
|
||||
</if>
|
||||
<if test="vo.lastUpdateTime != null ">
|
||||
and last_update_time = #{vo.lastUpdateTime}
|
||||
</if>
|
||||
</where>
|
||||
order by create_time desc
|
||||
<include refid="selecWzrListVo"/>
|
||||
where b.supplier_id is null
|
||||
<if test="vo.name != null and vo.name != ''">
|
||||
and csb.name = #{vo.name} or csb.name_en = #{vo.name}
|
||||
</if>
|
||||
<if test="vo.supplierType != null and vo.supplierType != ''">
|
||||
and supplier_type = #{vo.supplierType}
|
||||
</if>
|
||||
order by csb.create_time desc
|
||||
</select>
|
||||
|
||||
|
||||
@ -296,6 +239,12 @@
|
||||
<if test="vo.supplierType != null and vo.supplierType != ''">
|
||||
and supplier_type = #{vo.supplierType}
|
||||
</if>
|
||||
<if test="vo.supplierTypeList != null and vo.supplierTypeList.size > 0">
|
||||
AND supplier_type IN
|
||||
<foreach item="item" collection="vo.supplierTypeList" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="vo.licenceAccessory != null and vo.licenceAccessory != ''">
|
||||
and licence_accessory = #{vo.licenceAccessory}
|
||||
</if>
|
||||
@ -541,111 +490,117 @@
|
||||
<include refid="selectCoscoSupplierBaseVo"/>
|
||||
<where>
|
||||
and del_flag = 'normal'
|
||||
<if test="deptId != null and deptId != ''">
|
||||
and dept_id = #{vo.deptId}
|
||||
</if>
|
||||
<if test="supplierType != null and supplierType != ''">
|
||||
and supplier_type = #{supplierType}
|
||||
</if>
|
||||
<if test="licenceAccessory != null and licenceAccessory != ''">
|
||||
and licence_accessory = #{licenceAccessory}
|
||||
</if>
|
||||
<if test="licenceDate != null and licenceDate != ''">
|
||||
and licence_date = #{licenceDate}
|
||||
</if>
|
||||
<if test="enterpriseType != null and enterpriseType != ''">
|
||||
and enterprise_type = #{enterpriseType}
|
||||
</if>
|
||||
<if test="name != null and name != ''">
|
||||
and name like concat('%', #{name}, '%')
|
||||
</if>
|
||||
<if test="nameEn != null and nameEn != ''">
|
||||
and name_en = #{nameEn}
|
||||
</if>
|
||||
<if test="socialCreditCode != null and socialCreditCode != ''">
|
||||
and social_credit_code = #{socialCreditCode}
|
||||
</if>
|
||||
<if test="range != null and range != ''">
|
||||
and `range` = #{range}
|
||||
</if>
|
||||
<if test="regAddress != null and regAddress != ''">
|
||||
and reg_address = #{regAddress}
|
||||
</if>
|
||||
<if test="workAddress != null and workAddress != ''">
|
||||
and work_address = #{workAddress}
|
||||
</if>
|
||||
<if test="parentCompanyInvestor != null and parentCompanyInvestor != ''">
|
||||
and parent_company_investor = #{parentCompanyInvestor}
|
||||
</if>
|
||||
<if test="legalPerson != null and legalPerson != ''">
|
||||
and legal_person = #{legalPerson}
|
||||
</if>
|
||||
<if test="idCard != null and idCard != ''">
|
||||
and id_card = #{idCard}
|
||||
</if>
|
||||
<if test="capital != null ">
|
||||
and capital = #{capital}
|
||||
</if>
|
||||
<if test="contactsName != null and contactsName != ''">
|
||||
and contacts_name like concat('%', #{contactsName}, '%')
|
||||
</if>
|
||||
<if test="contactsPhone != null and contactsPhone != ''">
|
||||
and contacts_phone = #{contactsPhone}
|
||||
</if>
|
||||
<if test="contactsType != null and contactsType != ''">
|
||||
and contacts_type = #{contactsType}
|
||||
</if>
|
||||
<if test="contactsEmail != null and contactsEmail != ''">
|
||||
and contacts_email = #{contactsEmail}
|
||||
</if>
|
||||
<if test="telephone != null and telephone != ''">
|
||||
and telephone = #{telephone}
|
||||
</if>
|
||||
<if test="nation != null and nation != ''">
|
||||
and nation = #{nation}
|
||||
</if>
|
||||
<if test="vat != null and vat != ''">
|
||||
and vat = #{vat}
|
||||
</if>
|
||||
<if test="taxpayerId != null and taxpayerId != ''">
|
||||
and taxpayer_id = #{taxpayerId}
|
||||
</if>
|
||||
<if test="currency != null and currency != ''">
|
||||
and currency = #{currency}
|
||||
</if>
|
||||
<if test="personName != null and personName != ''">
|
||||
and person_name like concat('%', #{personName}, '%')
|
||||
</if>
|
||||
<if test="personPhone != null and personPhone != ''">
|
||||
and person_phone = #{personPhone}
|
||||
</if>
|
||||
<if test="personBank != null and personBank != ''">
|
||||
and person_bank = #{personBank}
|
||||
</if>
|
||||
<if test="personAccount != null and personAccount != ''">
|
||||
and person_account = #{personAccount}
|
||||
</if>
|
||||
<if test="accessStatus != null ">
|
||||
and access_status = #{accessStatus}
|
||||
</if>
|
||||
<if test="blacklistStatus != null ">
|
||||
and blacklist_status = #{blacklistStatus}
|
||||
</if>
|
||||
<if test="greylistStatus != null ">
|
||||
and greylist_status = #{greylistStatus}
|
||||
</if>
|
||||
<if test="fillinStatus != null ">
|
||||
and fillin_status = #{fillinStatus}
|
||||
</if>
|
||||
<if test="fillinBy != null and fillinBy != ''">
|
||||
and fillin_by = #{fillinBy}
|
||||
</if>
|
||||
<if test="sapCode != null and sapCode != ''">
|
||||
and sap_code = #{sapCode}
|
||||
</if>
|
||||
<if test="lastUpdateTime != null ">
|
||||
and last_update_time = #{lastUpdateTime}
|
||||
</if>
|
||||
<if test="deptId != null and deptId != ''">
|
||||
and dept_id = #{vo.deptId}
|
||||
</if>
|
||||
<if test="supplierTypeList != null and supplierTypeList.size > 0">
|
||||
AND supplier_type IN
|
||||
<foreach item="item" collection="supplierTypeList" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="supplierType != null and supplierType != ''">
|
||||
and supplier_type = #{supplierType}
|
||||
</if>
|
||||
<if test="licenceAccessory != null and licenceAccessory != ''">
|
||||
and licence_accessory = #{licenceAccessory}
|
||||
</if>
|
||||
<if test="licenceDate != null and licenceDate != ''">
|
||||
and licence_date = #{licenceDate}
|
||||
</if>
|
||||
<if test="enterpriseType != null and enterpriseType != ''">
|
||||
and enterprise_type = #{enterpriseType}
|
||||
</if>
|
||||
<if test="name != null and name != ''">
|
||||
and name like concat('%', #{name}, '%')
|
||||
</if>
|
||||
<if test="nameEn != null and nameEn != ''">
|
||||
and name_en = #{nameEn}
|
||||
</if>
|
||||
<if test="socialCreditCode != null and socialCreditCode != ''">
|
||||
and social_credit_code = #{socialCreditCode}
|
||||
</if>
|
||||
<if test="range != null and range != ''">
|
||||
and `range` = #{range}
|
||||
</if>
|
||||
<if test="regAddress != null and regAddress != ''">
|
||||
and reg_address = #{regAddress}
|
||||
</if>
|
||||
<if test="workAddress != null and workAddress != ''">
|
||||
and work_address = #{workAddress}
|
||||
</if>
|
||||
<if test="parentCompanyInvestor != null and parentCompanyInvestor != ''">
|
||||
and parent_company_investor = #{parentCompanyInvestor}
|
||||
</if>
|
||||
<if test="legalPerson != null and legalPerson != ''">
|
||||
and legal_person = #{legalPerson}
|
||||
</if>
|
||||
<if test="idCard != null and idCard != ''">
|
||||
and id_card = #{idCard}
|
||||
</if>
|
||||
<if test="capital != null ">
|
||||
and capital = #{capital}
|
||||
</if>
|
||||
<if test="contactsName != null and contactsName != ''">
|
||||
and contacts_name like concat('%', #{contactsName}, '%')
|
||||
</if>
|
||||
<if test="contactsPhone != null and contactsPhone != ''">
|
||||
and contacts_phone = #{contactsPhone}
|
||||
</if>
|
||||
<if test="contactsType != null and contactsType != ''">
|
||||
and contacts_type = #{contactsType}
|
||||
</if>
|
||||
<if test="contactsEmail != null and contactsEmail != ''">
|
||||
and contacts_email = #{contactsEmail}
|
||||
</if>
|
||||
<if test="telephone != null and telephone != ''">
|
||||
and telephone = #{telephone}
|
||||
</if>
|
||||
<if test="nation != null and nation != ''">
|
||||
and nation = #{nation}
|
||||
</if>
|
||||
<if test="vat != null and vat != ''">
|
||||
and vat = #{vat}
|
||||
</if>
|
||||
<if test="taxpayerId != null and taxpayerId != ''">
|
||||
and taxpayer_id = #{taxpayerId}
|
||||
</if>
|
||||
<if test="currency != null and currency != ''">
|
||||
and currency = #{currency}
|
||||
</if>
|
||||
<if test="personName != null and personName != ''">
|
||||
and person_name like concat('%', #{personName}, '%')
|
||||
</if>
|
||||
<if test="personPhone != null and personPhone != ''">
|
||||
and person_phone = #{personPhone}
|
||||
</if>
|
||||
<if test="personBank != null and personBank != ''">
|
||||
and person_bank = #{personBank}
|
||||
</if>
|
||||
<if test="personAccount != null and personAccount != ''">
|
||||
and person_account = #{personAccount}
|
||||
</if>
|
||||
<if test="accessStatus != null ">
|
||||
and access_status = #{accessStatus}
|
||||
</if>
|
||||
<if test="blacklistStatus != null ">
|
||||
and blacklist_status = #{blacklistStatus}
|
||||
</if>
|
||||
<if test="greylistStatus != null ">
|
||||
and greylist_status = #{greylistStatus}
|
||||
</if>
|
||||
<if test="fillinStatus != null ">
|
||||
and fillin_status = #{fillinStatus}
|
||||
</if>
|
||||
<if test="fillinBy != null and fillinBy != ''">
|
||||
and fillin_by = #{fillinBy}
|
||||
</if>
|
||||
<if test="sapCode != null and sapCode != ''">
|
||||
and sap_code = #{sapCode}
|
||||
</if>
|
||||
<if test="lastUpdateTime != null ">
|
||||
and last_update_time = #{lastUpdateTime}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
Reference in New Issue
Block a user