Merge branch 'dev' into docker_package
This commit is contained in:
commit
eaaac41e48
|
@ -1682,7 +1682,11 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
|
|||
list.addAll(query.list());
|
||||
}
|
||||
List<Long> resourceIds = getSourceIdsByProcess(list);
|
||||
resultMap.put("total", resourceDao.selectCountByIds(resourceIds));
|
||||
if (resourceIds.isEmpty()) {
|
||||
resultMap.put("total", 0);
|
||||
} else {
|
||||
resultMap.put("total", resourceDao.selectCountByIds(resourceIds));
|
||||
}
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
|
|
|
@ -76,22 +76,6 @@
|
|||
<result property="applyCount" column="applyCount"/>
|
||||
<result property="infoList" column="info_list"
|
||||
typeHandler="com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler"/>
|
||||
<!-- <collection property="infoList" javaType="List" ofType="attrEntity">-->
|
||||
<!-- <result property="id" column="id"/>-->
|
||||
<!-- <result property="dataResourceId" column="data_resource_id"/>-->
|
||||
<!-- <result property="attrType" column="attr_type"/>-->
|
||||
<!-- <result property="attrValue" column="attr_value"/>-->
|
||||
<!-- <result property="delFlag" column="del_flag"/>-->
|
||||
<!-- <result property="creator" column="creator"/>-->
|
||||
<!-- <result property="createDate" column="create_date"/>-->
|
||||
<!-- <result property="updater" column="updater"/>-->
|
||||
<!-- <result property="updateDate" column="update_date"/>-->
|
||||
<!-- <result property="note1" column="note1"/>-->
|
||||
<!-- <result property="note2" column="note2"/>-->
|
||||
<!-- <result property="note3" column="note3"/>-->
|
||||
<!-- <result property="note4" column="note4"/>-->
|
||||
<!-- <result property="note5" column="note5"/>-->
|
||||
<!-- </collection>-->
|
||||
</resultMap>
|
||||
|
||||
<update id="deleteByIds">
|
||||
|
@ -169,7 +153,6 @@
|
|||
<foreach collection="dto.infoList" item="item" separator="union all">
|
||||
SELECT data_resource_id FROM tb_data_attr
|
||||
WHERE attr_type = #{item.attrType}
|
||||
<!-- AND attr_value LIKE CONCAT('%', #{item.attrValue}, '%') -->
|
||||
AND MATCH ( attr_value) AGAINST ( #{item.attrValue} IN BOOLEAN MODE)
|
||||
AND del_flag = 0
|
||||
</foreach>) tb
|
||||
|
@ -1063,7 +1046,7 @@
|
|||
COUNT( tdav.data_resource_id ) AS total
|
||||
FROM
|
||||
(SELECT a.* FROM tb_data_attr a INNER JOIN tb_data_resource c ON a.data_resource_id = c.id
|
||||
INNER JOIN sys_dept b ON c.dept_id = b.id WHERE c.type =
|
||||
INNER JOIN sys_dept b ON c.dept_id = b.id WHERE c.type =
|
||||
#{resourceType} AND (b.id = #{id} OR INSTR(b.pids,#{id})) ) tdav
|
||||
JOIN mysql.help_topic b ON b.help_topic_id < ( LENGTH( tdav.attr_value ) - LENGTH( REPLACE ( tdav.attr_value,
|
||||
';', '' ) ) + 1 )
|
||||
|
@ -1081,16 +1064,16 @@
|
|||
COUNT( tdav.data_resource_id ) AS total
|
||||
FROM
|
||||
(
|
||||
SELECT b.* FROM
|
||||
(
|
||||
SELECT DISTINCT(c.id) AS id FROM
|
||||
(
|
||||
SELECT a.id FROM tb_data_resource a INNER JOIN sys_dept b ON a.dept_id = b.id
|
||||
WHERE a.del_flag = 0 AND a.type='应用资源' AND (b.id = #{id} OR INSTR(b.pids,#{id}))
|
||||
) a
|
||||
INNER JOIN tb_data_resource_rel b ON a.id = b.key_id INNER JOIN tb_data_resource c ON b.reference_id = c.id
|
||||
WHERE b.del_flag = 0 AND c.type = #{resourceType} AND c.del_flag = 0
|
||||
) a INNER JOIN tb_data_attr b ON a.id = b.data_resource_id AND b.del_flag = 0
|
||||
SELECT b.* FROM
|
||||
(
|
||||
SELECT DISTINCT(c.id) AS id FROM
|
||||
(
|
||||
SELECT a.id FROM tb_data_resource a INNER JOIN sys_dept b ON a.dept_id = b.id
|
||||
WHERE a.del_flag = 0 AND a.type='应用资源' AND (b.id = #{id} OR INSTR(b.pids,#{id}))
|
||||
) a
|
||||
INNER JOIN tb_data_resource_rel b ON a.id = b.key_id INNER JOIN tb_data_resource c ON b.reference_id = c.id
|
||||
WHERE b.del_flag = 0 AND c.type = #{resourceType} AND c.del_flag = 0
|
||||
) a INNER JOIN tb_data_attr b ON a.id = b.data_resource_id AND b.del_flag = 0
|
||||
) tdav
|
||||
JOIN mysql.help_topic b ON b.help_topic_id < ( LENGTH( tdav.attr_value ) - LENGTH( REPLACE ( tdav.attr_value,
|
||||
';', '' ) ) + 1 )
|
||||
|
@ -1232,7 +1215,7 @@
|
|||
tb_data_resource b
|
||||
ON
|
||||
a.reference_id = b.id
|
||||
INNER JOIN sys_dept c
|
||||
INNER JOIN sys_dept c
|
||||
ON b.dept_id = c.id
|
||||
WHERE
|
||||
a.del_flag = 0 AND b.del_flag = 0
|
||||
|
@ -1302,7 +1285,8 @@
|
|||
|
||||
<!-- 根据组件类型查询部门申请组件的数量-->
|
||||
<select id="assemblyCarByDept" parameterType="java.util.Map" resultType="java.util.Map">
|
||||
SELECT COUNT(a.id) as carNum FROM tb_resource_car a INNER JOIN sys_user b ON a.user_id = b.id INNER JOIN sys_dept c
|
||||
SELECT COUNT(a.id) as carNum FROM tb_resource_car a INNER JOIN sys_user b ON a.user_id = b.id INNER JOIN
|
||||
sys_dept c
|
||||
ON b.dept_id = c.id INNER JOIN tb_data_resource d ON a.resource_id = d.id
|
||||
WHERE a.del_flag = 0 AND (c.id = #{id} OR INSTR(c.pids,#{id})) AND d.type = #{resourceType} AND d.del_flag = 0
|
||||
</select>
|
||||
|
@ -1310,11 +1294,11 @@
|
|||
<!--根据组件类型查询部门使用组件的数量-->
|
||||
<select id="assemblyUseByDept" parameterType="java.util.Map" resultType="java.util.Map">
|
||||
SELECT COUNT(DISTINCT(b.reference_id)) AS useNum FROM
|
||||
(
|
||||
SELECT a.id FROM tb_data_resource a INNER JOIN sys_dept b ON a.dept_id = b.id
|
||||
WHERE a.del_flag = 0 AND a.type='应用资源' AND (b.id = #{id} OR INSTR(b.pids,#{id}))
|
||||
) a
|
||||
INNER JOIN tb_data_resource_rel b ON a.id = b.key_id WHERE b.del_flag = 0
|
||||
(
|
||||
SELECT a.id FROM tb_data_resource a INNER JOIN sys_dept b ON a.dept_id = b.id
|
||||
WHERE a.del_flag = 0 AND a.type='应用资源' AND (b.id = #{id} OR INSTR(b.pids,#{id}))
|
||||
) a
|
||||
INNER JOIN tb_data_resource_rel b ON a.id = b.key_id WHERE b.del_flag = 0
|
||||
</select>
|
||||
|
||||
<select id="selectCountByDepts" resultType="java.util.Map">
|
||||
|
@ -1342,9 +1326,11 @@
|
|||
WHERE 1=1
|
||||
AND del_flag = 0
|
||||
AND id in
|
||||
<foreach item="resourceId" collection="list" open="(" separator="," close=")">
|
||||
#{resourceId}
|
||||
</foreach>
|
||||
<if>
|
||||
<foreach item="resourceId" collection="list" open="(" separator="," close=")">
|
||||
#{resourceId}
|
||||
</foreach>
|
||||
</if>
|
||||
GROUP BY type
|
||||
ORDER BY type
|
||||
</select>
|
||||
|
@ -1363,47 +1349,48 @@
|
|||
|
||||
<select id="trafficDeptResource" resultType="java.util.Map">
|
||||
SELECT
|
||||
SUBSTR(create_date, 1, 10) AS "date",
|
||||
COUNT( id ) AS "count"
|
||||
SUBSTR(create_date, 1, 10) AS "date",
|
||||
COUNT( id ) AS "count"
|
||||
FROM
|
||||
tb_data_resource tdr
|
||||
tb_data_resource tdr
|
||||
WHERE
|
||||
1 = 1
|
||||
AND del_flag = 0
|
||||
1 = 1
|
||||
AND del_flag = 0
|
||||
<if test="null != deptIds">
|
||||
AND tdr.dept_id IN
|
||||
<foreach item="deptId" collection="deptIds" open="(" separator="," close=")">
|
||||
#{deptId}
|
||||
</foreach>
|
||||
</if>
|
||||
AND SUBSTR(create_date, 1, 10) BETWEEN #{startDate} AND #{endDate}
|
||||
AND SUBSTR(create_date, 1, 10) BETWEEN #{startDate} AND #{endDate}
|
||||
GROUP BY
|
||||
SUBSTR(create_date, 1, 10)
|
||||
SUBSTR(create_date, 1, 10)
|
||||
</select>
|
||||
|
||||
<select id="selectDayAvg" resultType="java.lang.Long">
|
||||
SELECT IFNULL(COUNT(id), 0) / ${days}
|
||||
FROM tb_data_resource
|
||||
WHERE 1 = 1
|
||||
AND del_flag=0
|
||||
AND del_flag=0
|
||||
</select>
|
||||
|
||||
<select id="selectDayMax" resultType="java.lang.Integer">
|
||||
SELECT IFNULL(MAX(count), 0)
|
||||
FROM
|
||||
(SELECT
|
||||
COUNT( id ) AS "count"
|
||||
FROM
|
||||
tb_data_resource
|
||||
WHERE
|
||||
1 = 1
|
||||
AND del_flag = 0
|
||||
GROUP BY
|
||||
SUBSTR(create_date, 1, 10)) temp
|
||||
(SELECT
|
||||
COUNT( id ) AS "count"
|
||||
FROM
|
||||
tb_data_resource
|
||||
WHERE
|
||||
1 = 1
|
||||
AND del_flag = 0
|
||||
GROUP BY
|
||||
SUBSTR(create_date, 1, 10)) temp
|
||||
</select>
|
||||
|
||||
<select id="selectCameraDTOById" resultMap="resourceDTO">
|
||||
SELECT tdr.*, tda.* FROM tb_data_resource tdr, tb_data_attr tda WHERE tdr.id = tda.data_resource_id AND tdr.del_flag = 0 AND tdr.id = #{id}
|
||||
SELECT tdr.*, tda.* FROM tb_data_resource tdr, tb_data_attr tda WHERE tdr.id = tda.data_resource_id AND
|
||||
tdr.del_flag = 0 AND tdr.id = #{id}
|
||||
</select>
|
||||
|
||||
</mapper>
|
Loading…
Reference in New Issue