优化以及地市
This commit is contained in:
@ -52,12 +52,29 @@
|
||||
LEFT JOIN cosco_supplierexit cse ON cse.id = cas.supplierexit_id
|
||||
LEFT JOIN cosco_access_work caw ON caw.id = cas.access_work_id
|
||||
left join (
|
||||
select cac.access_work_id,GROUP_CONCAT(DISTINCT cc.category_name SEPARATOR ', ') AS categoryNames from cosco_access_supplier_category cac
|
||||
left join cosco_category cc on cac.category_id = cc.id
|
||||
GROUP BY access_work_id
|
||||
SELECT
|
||||
cac.access_work_id,
|
||||
GROUP_CONCAT(cc.id SEPARATOR ', ') AS categoryId,
|
||||
GROUP_CONCAT(cc.category_name SEPARATOR ', ') AS categoryNames
|
||||
FROM cosco_access_supplier_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 = caw.id
|
||||
WHERE
|
||||
cas.supplier_id = #{vo.supplierId}
|
||||
<if test="vo.categoryNames != null and vo.categoryNames != ''">
|
||||
and c.categoryNames like concat('%', #{vo.categoryNames}, '%')
|
||||
</if>
|
||||
<if test="vo.categoryId != null and vo.categoryId != ''">
|
||||
and c.categoryId like concat('%', #{vo.categoryId}, '%')
|
||||
</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>
|
||||
AND cas.access_status IN (1,2)
|
||||
ORDER BY caw.update_time desc
|
||||
</select>
|
||||
|
@ -157,9 +157,12 @@
|
||||
LEFT JOIN cosco_access_work caw ON cas.access_work_id = caw.id
|
||||
LEFT JOIN cosco_supplier_base csb ON cas.supplier_id = csb.id
|
||||
left join (
|
||||
select cac.access_work_id,GROUP_CONCAT(DISTINCT cc.category_name SEPARATOR ', ') AS categoryName from cosco_access_supplier_category cac
|
||||
left join cosco_category cc on cac.category_id = cc.id
|
||||
GROUP BY access_work_id
|
||||
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 = caw.id
|
||||
left join dict_project dp on csb.enterprise_type = dp.`code` and dp.parent_code = 'enterprise_type'
|
||||
</sql>
|
||||
@ -449,14 +452,6 @@
|
||||
and csb.last_update_time = #{vo.lastUpdateTime}
|
||||
</if>
|
||||
</where>
|
||||
GROUP BY
|
||||
cas.id,
|
||||
cas.access_work_id,
|
||||
cas.supplier_id,
|
||||
csb.`name`,
|
||||
caw.update_time ,
|
||||
csb.enterprise_type,
|
||||
dp.dic_name
|
||||
order by csb.create_time desc
|
||||
</select>
|
||||
|
||||
|
Reference in New Issue
Block a user