修改getImgServices的子查询sql语句为兼容mysql5.7

This commit is contained in:
yitonglei 2022-08-22 09:01:26 +08:00
parent b428b74e90
commit 26ee20e34c
1 changed files with 17 additions and 13 deletions

View File

@ -1631,19 +1631,23 @@
</select>
<select id="getImgServices" resultType="java.util.Map">
with A as
(
SELECT m.* FROM
(
SELECT a.name,a.id,a.info_list FROM tb_data_resource a INNER JOIN tb_data_attr b ON a.id = b.data_resource_id
WHERE a.dept_id = #{deptid} AND a.del_flag = 0 and a.type = '组件服务'
AND (b.attr_type = '组件类型' AND b.attr_value = '图层服务' ) AND b.del_flag = 0
) m
INNER JOIN tb_data_attr b ON m.id = b.data_resource_id
AND b.attr_type = '分类' AND LOCATE(#{type},b.attr_value) AND b.del_flag = 0
)
SELECT A.*,IFNULL(c.attr_value,'') as link FROM A LEFT JOIN tb_data_attr c ON A.id = c.data_resource_id
AND c.attr_type = '图层缩略图' AND c.del_flag = 0
SELECT A.*,IFNULL(c.attr_value,'') as link
FROM
(
SELECT m.* FROM
(
SELECT a.name,a.id,a.info_list FROM tb_data_resource a INNER JOIN tb_data_attr b ON a.id = b.data_resource_id
WHERE a.dept_id = #{deptid} AND a.del_flag = 0 and a.type = '组件服务'
AND (b.attr_type = '组件类型' AND b.attr_value = '图层服务' ) AND b.del_flag = 0
) m
INNER JOIN tb_data_attr b ON m.id = b.data_resource_id
AND b.attr_type = '分类' AND LOCATE(#{type},b.attr_value) AND b.del_flag = 0
) A
LEFT JOIN tb_data_attr c
ON A.id = c.data_resource_id
AND c.attr_type = '图层缩略图'
AND c.del_flag = 0
</select>
<select id="cimAssemblyResources" resultType="java.util.Map">