Merge branch 'master' into docker_package
This commit is contained in:
commit
847a55b79f
File diff suppressed because one or more lines are too long
|
@ -279,8 +279,7 @@
|
|||
IFNULL( trc.collectCount, 0 ) AS "collectCount",
|
||||
sd.NAME AS "deptName",
|
||||
IFNULL( trc2.isCollect, 'false' ) AS "isCollect",
|
||||
IF
|
||||
( taa2.approve_status < 1, '未申请', '已申请' ) AS "applyState"
|
||||
IF( IFNULL(taa2.approve_status, 0) < 1, '未申请', '已申请' ) AS "applyState"
|
||||
FROM
|
||||
tb_data_resource tdr
|
||||
LEFT JOIN ( SELECT resource_id, AVG( score ) AS "score" FROM tb_resource_score WHERE 1 = 1 AND del_flag = 0
|
||||
|
|
|
@ -12,7 +12,8 @@
|
|||
<result property="creator" column="creator"/>
|
||||
<result property="updateDate" column="update_date"/>
|
||||
<result property="updater" column="updater"/>
|
||||
<result property="note1" column="note1" typeHandler="com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler"/>
|
||||
<result property="note1" column="note1"
|
||||
typeHandler="com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler"/>
|
||||
<result property="note2" column="note2"/>
|
||||
<result property="note3" column="note3"/>
|
||||
<result property="note4" column="note4"/>
|
||||
|
@ -22,12 +23,12 @@
|
|||
<update id="deleteByIds">
|
||||
UPDATE tb_resource_car
|
||||
SET del_flag = 1 ,
|
||||
update_date = now()
|
||||
update_date = now()
|
||||
WHERE 1 = 1
|
||||
AND id IN
|
||||
<foreach collection="ids" item="item" open="(" close=")" separator=",">
|
||||
AND id IN
|
||||
<foreach collection="ids" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
<update id="delete4Resource">
|
||||
|
@ -42,38 +43,38 @@
|
|||
</update>
|
||||
|
||||
<select id="selectPageWithResource" resultType="io.renren.modules.resourceCar.dto.ResourceCarDTO">
|
||||
SELECT trc.*
|
||||
FROM tb_resource_car trc
|
||||
SELECT trc.*
|
||||
FROM tb_resource_car trc
|
||||
<if test="(params.type != null and params.type != '') or (params.name != null and params.name != '')">
|
||||
LEFT JOIN tb_data_resource tdr ON trc.resource_id = tdr.id AND tdr.del_flag != 1
|
||||
</if>
|
||||
WHERE 1 = 1
|
||||
AND trc.del_flag = 0
|
||||
AND user_id = #{params.userId}
|
||||
<if test="params.name != null and params.name != ''" >
|
||||
WHERE 1 = 1
|
||||
AND trc.del_flag = 0
|
||||
AND user_id = #{params.userId}
|
||||
<if test="params.name != null and params.name != ''">
|
||||
AND tdr.name LIKE CONCAT('%',#{params.name},'%')
|
||||
</if>
|
||||
<if test="params.type != null and params.type != ''">
|
||||
AND tdr.type = #{params.type}
|
||||
</if>
|
||||
ORDER BY trc.update_date DESC, trc.create_date DESC
|
||||
LIMIT ${pageNum}, ${pageSize}
|
||||
ORDER BY trc.update_date DESC, trc.create_date DESC
|
||||
LIMIT ${pageNum}, ${pageSize}
|
||||
</select>
|
||||
|
||||
<select id="selectResourceCarGroupByDept" resultType="java.util.Map">
|
||||
SELECT
|
||||
res.dept_id AS "deptId",
|
||||
dept.name AS "deptName",
|
||||
COUNT(car.id) AS "count"
|
||||
res.dept_id AS "deptId",
|
||||
dept.name AS "deptName",
|
||||
COUNT(car.id) AS "count"
|
||||
FROM
|
||||
tb_resource_car car,
|
||||
tb_data_resource res,
|
||||
sys_dept dept
|
||||
tb_resource_car car,
|
||||
tb_data_resource res,
|
||||
sys_dept dept
|
||||
WHERE car.user_id = #{userId}
|
||||
AND car.resource_id = res.id
|
||||
AND res.dept_id = dept.id
|
||||
AND car.del_flag = 0
|
||||
AND EXISTS (SELECT 1 FROM tb_data_resource WHERE tb_data_resource.id = car.resource_id)
|
||||
AND car.resource_id = res.id
|
||||
AND res.dept_id = dept.id
|
||||
AND car.del_flag = 0
|
||||
AND EXISTS (SELECT 1 FROM tb_data_resource WHERE tb_data_resource.id = car.resource_id)
|
||||
<if test="name != null and name != ''">
|
||||
AND res.name LIKE CONCAT('%',#{name},'%')
|
||||
</if>
|
||||
|
@ -83,74 +84,75 @@
|
|||
|
||||
<select id="selectResourceListByDept" resultType="java.util.Map">
|
||||
SELECT
|
||||
car.id AS "id",
|
||||
res.id AS "resourceId",
|
||||
res.NAME AS "resourceName",
|
||||
res.description,
|
||||
res.type,
|
||||
res.del_flag AS "delFlag",
|
||||
car.note1,
|
||||
car.create_date AS "time",
|
||||
tda.attr_value AS "componentType"
|
||||
car.id AS "id",
|
||||
res.id AS "resourceId",
|
||||
res.NAME AS "resourceName",
|
||||
res.description,
|
||||
res.type,
|
||||
res.del_flag AS "delFlag",
|
||||
car.note1,
|
||||
car.create_date AS "time",
|
||||
tda.attr_value AS "componentType"
|
||||
FROM
|
||||
tb_resource_car car,
|
||||
tb_data_resource res,
|
||||
tb_data_attr tda
|
||||
tb_resource_car car,
|
||||
tb_data_resource res,
|
||||
tb_data_attr tda
|
||||
WHERE 1 = 1
|
||||
AND car.resource_id = res.id
|
||||
AND res.id = tda.data_resource_id
|
||||
AND car.resource_id != 8888888880000000001
|
||||
AND tda.attr_type = '组件类型'
|
||||
AND tda.del_flag = 0
|
||||
AND car.user_id = #{userId}
|
||||
AND res.dept_id = #{deptId}
|
||||
AND car.del_flag = 0
|
||||
AND EXISTS (SELECT 1 FROM tb_data_resource WHERE tb_data_resource.id = car.resource_id)
|
||||
AND car.resource_id = res.id
|
||||
AND res.id = tda.data_resource_id
|
||||
AND car.resource_id != 8888888880000000001
|
||||
AND (tda.attr_type = '组件类型' OR tda.attr_type ='应用状态')
|
||||
<!-- AND (res.type = '组件服务' OR res.type = '应用资源')-->
|
||||
AND tda.del_flag = 0
|
||||
AND car.user_id = #{userId}
|
||||
AND res.dept_id = #{deptId}
|
||||
AND car.del_flag = 0
|
||||
AND EXISTS (SELECT 1 FROM tb_data_resource WHERE tb_data_resource.id = car.resource_id)
|
||||
UNION (
|
||||
SELECT
|
||||
car.id AS "id",
|
||||
res.id AS "resourceId",
|
||||
'申请摄像头列表' AS "resourceName",
|
||||
res.description,
|
||||
res.type,
|
||||
0 AS "delFlag",
|
||||
car.note1,
|
||||
car.create_date AS "time",
|
||||
"" AS "componentType"
|
||||
car.id AS "id",
|
||||
res.id AS "resourceId",
|
||||
'申请摄像头列表' AS "resourceName",
|
||||
res.description,
|
||||
res.type,
|
||||
0 AS "delFlag",
|
||||
car.note1,
|
||||
car.create_date AS "time",
|
||||
"" AS "componentType"
|
||||
FROM
|
||||
tb_resource_car car,
|
||||
tb_data_resource res
|
||||
tb_resource_car car,
|
||||
tb_data_resource res
|
||||
WHERE
|
||||
1 = 1
|
||||
AND car.resource_id = res.id
|
||||
AND car.resource_id = 8888888880000000001
|
||||
AND car.user_id = #{userId}
|
||||
AND res.dept_id = #{deptId}
|
||||
AND car.del_flag = 0)
|
||||
1 = 1
|
||||
AND car.resource_id = res.id
|
||||
AND car.resource_id = 8888888880000000001
|
||||
AND car.user_id = #{userId}
|
||||
AND res.dept_id = #{deptId}
|
||||
AND car.del_flag = 0)
|
||||
LIMIT ${pageNum}, ${pageSize}
|
||||
</select>
|
||||
|
||||
<select id="selectProvideDeptCount" resultType="java.lang.Integer">
|
||||
SELECT
|
||||
COUNT(*)
|
||||
COUNT(*)
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
tdr.dept_id
|
||||
FROM
|
||||
tb_resource_car trc
|
||||
LEFT JOIN tb_data_resource tdr ON trc.resource_id = tdr.id
|
||||
WHERE
|
||||
1 = 1
|
||||
AND trc.user_id = #{userId}
|
||||
AND trc.del_flag = 0
|
||||
AND EXISTS (SELECT 1 FROM tb_data_resource WHERE tb_data_resource.id = trc.resource_id)
|
||||
<if test="name != null and name != ''">
|
||||
AND tdr.name LIKE CONCAT('%',#{name},'%')
|
||||
</if>
|
||||
GROUP BY
|
||||
tdr.dept_id
|
||||
) temp
|
||||
(
|
||||
SELECT
|
||||
tdr.dept_id
|
||||
FROM
|
||||
tb_resource_car trc
|
||||
LEFT JOIN tb_data_resource tdr ON trc.resource_id = tdr.id
|
||||
WHERE
|
||||
1 = 1
|
||||
AND trc.user_id = #{userId}
|
||||
AND trc.del_flag = 0
|
||||
AND EXISTS (SELECT 1 FROM tb_data_resource WHERE tb_data_resource.id = trc.resource_id)
|
||||
<if test="name != null and name != ''">
|
||||
AND tdr.name LIKE CONCAT('%',#{name},'%')
|
||||
</if>
|
||||
GROUP BY
|
||||
tdr.dept_id
|
||||
) temp
|
||||
</select>
|
||||
|
||||
</mapper>
|
Loading…
Reference in New Issue