供应商查询
This commit is contained in:
@ -37,22 +37,42 @@
|
||||
left join cosco_category ca on c.category_id = ca.id and ca.del_flag = 'normal'
|
||||
</sql>
|
||||
|
||||
<select id="selectPageList" parameterType="com.chinaunicom.zyhy.ebtp.supplier.coscosupplier.entity.CoscoAccessSupplierCategory" resultMap="CoscoAccessSupplierCategoryResult">
|
||||
<include refid="selectCoscoAccessSupplierCategoryVo"/>
|
||||
<where>
|
||||
c.del_flag = 'normal'
|
||||
<if test="vo.accessWorkId != null and vo.accessWorkId != ''">
|
||||
and c.access_work_id = #{vo.accessWorkId}
|
||||
</if>
|
||||
<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.category_id = #{vo.categoryId}
|
||||
</if>
|
||||
<if test="vo.lastUpdateTime != null ">
|
||||
and c.last_update_time = #{vo.lastUpdateTime}
|
||||
</if>
|
||||
</where>
|
||||
order by c.create_time desc
|
||||
</select>
|
||||
|
||||
<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 c.access_work_id = #{accessWorkId}
|
||||
</if>
|
||||
<if test="supplierId != null and supplierId != ''">
|
||||
and c.supplier_id = #{supplierId}
|
||||
</if>
|
||||
<if test="categoryId != null and categoryId != ''">
|
||||
and c.category_id = #{categoryId}
|
||||
</if>
|
||||
<if test="lastUpdateTime != null ">
|
||||
and c.last_update_time = #{lastUpdateTime}
|
||||
</if>
|
||||
<if test="accessWorkId != null and accessWorkId != ''">
|
||||
and c.access_work_id = #{accessWorkId}
|
||||
</if>
|
||||
<if test="supplierId != null and supplierId != ''">
|
||||
and c.supplier_id = #{supplierId}
|
||||
</if>
|
||||
<if test="categoryId != null and categoryId != ''">
|
||||
and c.category_id = #{categoryId}
|
||||
</if>
|
||||
<if test="lastUpdateTime != null ">
|
||||
and c.last_update_time = #{lastUpdateTime}
|
||||
</if>
|
||||
</where>
|
||||
order by c.create_time desc
|
||||
</select>
|
||||
|
@ -46,17 +46,92 @@
|
||||
<result property="updateBy" column="update_by"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
<result property="lastUpdateTime" column="last_update_time"/>
|
||||
<result property="supplierTypeCn" column="supplier_type_cn"/>
|
||||
<result property="accessStatusCn" column="access_status_cn"/>
|
||||
<result property="deptId" column="dept_id"/>
|
||||
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectCoscoSupplierBaseVo">
|
||||
select id, supplier_type, licence_accessory, licence_date, enterprise_type, name, name_en, social_credit_code, `range`, reg_address, work_address, parent_company_investor, legal_person, id_card, capital, contacts_name, contacts_phone, contacts_type, contacts_email, telephone, nation, vat, taxpayer_id, currency, person_name, person_phone, person_bank, person_account, remark, access_status, blacklist_status, greylist_status, fillin_status, fillin_by, sap_code, del_flag, create_by, create_time, update_by, update_time, last_update_time
|
||||
from cosco_supplier_base
|
||||
SELECT
|
||||
id,
|
||||
dept_id,
|
||||
supplier_type,
|
||||
CASE supplier_type
|
||||
WHEN 'dvs' THEN '境内企业'
|
||||
WHEN 'ovs' THEN '境外企业'
|
||||
WHEN 'pe' THEN '个人'
|
||||
ELSE supplier_type
|
||||
END AS supplier_type_cn,
|
||||
licence_accessory,
|
||||
licence_date,
|
||||
enterprise_type,
|
||||
name,
|
||||
name_en,
|
||||
social_credit_code,
|
||||
`range`,
|
||||
reg_address,
|
||||
work_address,
|
||||
parent_company_investor,
|
||||
legal_person,
|
||||
id_card,
|
||||
capital,
|
||||
contacts_name,
|
||||
contacts_phone,
|
||||
contacts_type,
|
||||
contacts_email,
|
||||
telephone,
|
||||
nation,
|
||||
vat,
|
||||
taxpayer_id,
|
||||
currency,
|
||||
person_name,
|
||||
person_phone,
|
||||
person_bank,
|
||||
person_account,
|
||||
remark,
|
||||
access_status,
|
||||
CASE access_status
|
||||
WHEN 0 THEN '未准入'
|
||||
WHEN 1 THEN '已准入'
|
||||
ELSE CAST(access_status AS CHAR)
|
||||
END AS access_status_cn,
|
||||
blacklist_status,
|
||||
CASE blacklist_status
|
||||
WHEN 0 THEN '未加入'
|
||||
WHEN 1 THEN '已加入'
|
||||
ELSE CAST(blacklist_status AS CHAR)
|
||||
END AS blacklist_status_cn,
|
||||
greylist_status,
|
||||
CASE greylist_status
|
||||
WHEN 0 THEN '未加入'
|
||||
WHEN 1 THEN '已加入'
|
||||
ELSE CAST(greylist_status AS CHAR)
|
||||
END AS greylist_status_cn,
|
||||
fillin_status,
|
||||
CASE fillin_status
|
||||
WHEN 0 THEN '否'
|
||||
WHEN 1 THEN '是'
|
||||
ELSE CAST(fillin_status AS CHAR)
|
||||
END AS fillin_status_cn,
|
||||
fillin_by,
|
||||
sap_code,
|
||||
create_by,
|
||||
create_time,
|
||||
update_by,
|
||||
update_time,
|
||||
last_update_time
|
||||
FROM
|
||||
cosco_supplier_base
|
||||
</sql>
|
||||
|
||||
<select id="selectPageList" parameterType="com.chinaunicom.zyhy.ebtp.supplier.coscosupplier.entity.CoscoSupplierBase" resultMap="CoscoSupplierBaseResult">
|
||||
<include refid="selectCoscoSupplierBaseVo"/>
|
||||
<where>
|
||||
and del_flag = 'normal'
|
||||
<if test="vo.deptId != null and vo.deptId != ''">
|
||||
and dept_id = #{vo.deptId}
|
||||
</if>
|
||||
<if test="vo.supplierType != null and vo.supplierType != ''">
|
||||
and supplier_type = #{vo.supplierType}
|
||||
</if>
|
||||
@ -168,6 +243,9 @@
|
||||
<include refid="selectCoscoSupplierBaseVo"/>
|
||||
<where>
|
||||
and del_flag = 'normal'
|
||||
<if test="vo.deptId != null and vo.deptId != ''">
|
||||
and dept_id = #{vo.deptId}
|
||||
</if>
|
||||
<if test="supplierType != null and supplierType != ''">
|
||||
and supplier_type = #{supplierType}
|
||||
</if>
|
||||
@ -499,6 +577,9 @@
|
||||
<if test="lastUpdateTime != null">last_update_time =
|
||||
#{lastUpdateTime},
|
||||
</if>
|
||||
<if test="deptId != null and deptId != ''">dept_id =
|
||||
#{deptId},
|
||||
</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
@ -38,28 +38,44 @@
|
||||
|
||||
<select id="selectPageList" parameterType="com.chinaunicom.zyhy.ebtp.supplier.coscosupplier.entity.CoscoSupplierChangeApply" resultMap="CoscoSupplierChangeApplyResult">
|
||||
SELECT
|
||||
ca.id,
|
||||
sb.`name` as supplierName ,
|
||||
csca.id,
|
||||
sb.id as supplier_id,
|
||||
csca.change_time,
|
||||
CASE
|
||||
WHEN sb.supplier_type = 'dvs' THEN '境内企业'
|
||||
WHEN sb.supplier_type = 'ovs' THEN '境外企业'
|
||||
WHEN sb.supplier_type = 'pe' THEN '个人'
|
||||
WHEN sb.supplier_type = 'dvs' THEN
|
||||
'境内企业'
|
||||
WHEN sb.supplier_type = 'ovs' THEN
|
||||
'境外企业'
|
||||
WHEN sb.supplier_type = 'pe' THEN
|
||||
'个人'
|
||||
END AS supplier_type,
|
||||
sb.enterprise_type,
|
||||
caw.update_time,
|
||||
ca.change_time,
|
||||
CASE
|
||||
WHEN ca.approve_status = 0 THEN '审批中'
|
||||
WHEN ca.approve_status = 1 THEN '通过'
|
||||
WHEN ca.approve_status = 2 THEN '驳回'
|
||||
ELSE CAST(ca.approve_status AS CHAR)
|
||||
END AS approve_status_text
|
||||
|
||||
WHEN csca.approve_status = 0 THEN
|
||||
'审批中'
|
||||
WHEN csca.approve_status = 1 THEN
|
||||
'通过'
|
||||
WHEN csca.approve_status = 2 THEN
|
||||
'驳回'
|
||||
END AS approve_status_text,
|
||||
sb.`name` as supplierName,
|
||||
sb.enterprise_type,
|
||||
caw.update_time
|
||||
FROM
|
||||
cosco_supplier_change_apply ca
|
||||
left join cosco_supplier_base sb on sb.id = ca.supplier_id and sb.del_flag = 'normal'
|
||||
cosco_supplier_base sb
|
||||
LEFT JOIN (
|
||||
SELECT c.id, c.supplier_id, c.change_time, c.approve_status
|
||||
FROM cosco_supplier_change_apply c
|
||||
INNER JOIN (
|
||||
SELECT supplier_id, MAX(change_time) AS latest_time
|
||||
FROM cosco_supplier_change_apply
|
||||
GROUP BY supplier_id
|
||||
) m ON c.supplier_id = m.supplier_id AND c.change_time = m.latest_time
|
||||
|
||||
) csca ON sb.id = csca.supplier_id
|
||||
left join cosco_access_supplier cas on sb.id = cas.supplier_id
|
||||
left join cosco_access_work caw on cas.access_work_id = caw.id and caw.del_flag = 'normal'
|
||||
where sb.access_status = 1 and sb.blacklist_status = 0 and sb.greylist_status = 0 and caw.apply_type = 0 and ca.del_flag = 'normal'
|
||||
where sb.access_status = 1 and sb.blacklist_status = 0 and sb.greylist_status = 0 and caw.apply_type = 0 and sb.del_flag = 'normal'
|
||||
<if test="vo.supplierName != null and vo.supplierName != ''">
|
||||
and sb.name like concat('%', #{vo.supplierName}, '%')
|
||||
</if>
|
||||
@ -67,38 +83,38 @@
|
||||
and sb.supplier_type = #{vo.supplierType}
|
||||
</if>
|
||||
<if test="vo.startTime!=null and vo.startTime != ''">
|
||||
and ca.change_time >= #{vo.startTime}
|
||||
and csca.change_time >= #{vo.startTime}
|
||||
</if>
|
||||
<if test="vo.endTime!=null and vo.endTime != ''">
|
||||
and ca.change_time <= #{vo.endTime}
|
||||
and csca.change_time <= #{vo.endTime}
|
||||
</if>
|
||||
<if test="vo.approveStatus!=null and vo.approveStatus != ''">
|
||||
and ca.approve_status = #{vo.approveStatus}
|
||||
and csca.approve_status = #{vo.approveStatus}
|
||||
</if>
|
||||
order by ca.create_time desc
|
||||
order by sb.create_time desc
|
||||
</select>
|
||||
|
||||
<select id="selectCoscoSupplierChangeApplyList" parameterType="com.chinaunicom.zyhy.ebtp.supplier.coscosupplier.entity.CoscoSupplierChangeApply" resultMap="CoscoSupplierChangeApplyResult">
|
||||
<include refid="selectCoscoSupplierChangeApplyVo"/>
|
||||
<where>
|
||||
<if test="supplierId != null and supplierId != ''">
|
||||
and supplier_id = #{supplierId}
|
||||
</if>
|
||||
<if test="changeBy != null and changeBy != ''">
|
||||
and change_by = #{changeBy}
|
||||
</if>
|
||||
<if test="changeTime != null ">
|
||||
and change_time = #{changeTime}
|
||||
</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="vo.supplierId != null and vo.supplierId != ''">
|
||||
and supplier_id = #{vo.supplierId}
|
||||
</if>
|
||||
<if test="vo.changeBy != null and vo.changeBy != ''">
|
||||
and change_by = #{vo.changeBy}
|
||||
</if>
|
||||
<if test="vo.changeTime != null ">
|
||||
and change_time = #{vo.changeTime}
|
||||
</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.lastUpdateTime}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
Reference in New Issue
Block a user