|
|
|
@ -345,14 +345,16 @@
|
|
|
|
|
SELECT
|
|
|
|
|
COUNT( 1 )
|
|
|
|
|
FROM
|
|
|
|
|
( SELECT id FROM t_ability_application WHERE user_id = #{userId} AND resource_id = #{resourceId} AND IFNULL( expire_date > #{today}, 1 ) > 0 ) temp
|
|
|
|
|
( SELECT id FROM t_ability_application WHERE user_id = #{userId} AND resource_id = #{resourceId} AND IFNULL(
|
|
|
|
|
expire_date > #{today}, 1 ) > 0 ) temp
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="getFundStatement" resultType="java.util.Map">
|
|
|
|
|
SELECT
|
|
|
|
|
taa.id,
|
|
|
|
|
tdr.NAME AS "resourceName",
|
|
|
|
|
( CASE tdr.type WHEN '应用资源' THEN tdr.type WHEN '组件服务' THEN attr.attr_value ELSE tdr.type END ) AS "resourceType",
|
|
|
|
|
( CASE tdr.type WHEN '应用资源' THEN tdr.type WHEN '组件服务' THEN attr.attr_value ELSE tdr.type END ) AS
|
|
|
|
|
"resourceType",
|
|
|
|
|
sd.NAME AS "provideDept",
|
|
|
|
|
taa.unit AS "applyDept",
|
|
|
|
|
taa.create_date AS "applyDate",
|
|
|
|
@ -362,7 +364,8 @@
|
|
|
|
|
t_ability_application taa
|
|
|
|
|
LEFT JOIN tb_data_resource tdr ON taa.resource_id = tdr.id
|
|
|
|
|
LEFT JOIN sys_dept sd ON tdr.dept_id = sd.id
|
|
|
|
|
LEFT JOIN ( SELECT data_resource_id, attr_type, attr_value FROM tb_data_attr tda WHERE del_flag = 0 AND attr_type = '组件类型' ) attr ON tdr.id = attr.data_resource_id
|
|
|
|
|
LEFT JOIN ( SELECT data_resource_id, attr_type, attr_value FROM tb_data_attr tda WHERE del_flag = 0 AND
|
|
|
|
|
attr_type = '组件类型' ) attr ON tdr.id = attr.data_resource_id
|
|
|
|
|
WHERE
|
|
|
|
|
1 = 1
|
|
|
|
|
AND tdr.del_flag = 0
|
|
|
|
@ -378,23 +381,24 @@
|
|
|
|
|
</choose>
|
|
|
|
|
AND taa.del_flag = 0
|
|
|
|
|
AND tdr.del_flag = 0
|
|
|
|
|
<if test = "params.startDate != null and params.startDate != ''" >
|
|
|
|
|
<if test="params.startDate != null and params.startDate != ''">
|
|
|
|
|
AND taa.create_date >= #{params.startDate}
|
|
|
|
|
</if>
|
|
|
|
|
<if test = "params.endDate != null and params.endDate != ''" >
|
|
|
|
|
<if test="params.endDate != null and params.endDate != ''">
|
|
|
|
|
AND #{params.endDate} >= taa.create_date
|
|
|
|
|
</if>
|
|
|
|
|
<if test = "params.provideDept != null and params.provideDept != ''" >
|
|
|
|
|
<if test="params.provideDept != null and params.provideDept != ''">
|
|
|
|
|
AND sd.id = #{params.provideDept}
|
|
|
|
|
</if>
|
|
|
|
|
<if test = "params.applyDept != null and params.applyDept != ''" >
|
|
|
|
|
<if test="params.applyDept != null and params.applyDept != ''">
|
|
|
|
|
AND taa.unit LIKE CONCAT('%', #{params.applyDept} ,'%')
|
|
|
|
|
</if>
|
|
|
|
|
<if test = "params.resourceName != null and params.resourceName != ''" >
|
|
|
|
|
<if test="params.resourceName != null and params.resourceName != ''">
|
|
|
|
|
AND tdr.NAME LIKE CONCAT('%', #{params.resourceName} ,'%')
|
|
|
|
|
</if>
|
|
|
|
|
<if test = "params.resourceType != null and params.resourceType != ''" >
|
|
|
|
|
AND ( CASE tdr.type WHEN '应用资源' THEN tdr.type WHEN '组件服务' THEN attr.attr_value ELSE tdr.type END ) = #{params.resourceType}
|
|
|
|
|
<if test="params.resourceType != null and params.resourceType != ''">
|
|
|
|
|
AND ( CASE tdr.type WHEN '应用资源' THEN tdr.type WHEN '组件服务' THEN attr.attr_value ELSE tdr.type END ) =
|
|
|
|
|
#{params.resourceType}
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
|
|
UNION ALL
|
|
|
|
@ -423,22 +427,22 @@
|
|
|
|
|
AND tmb.state IN (0, 2)
|
|
|
|
|
</otherwise>
|
|
|
|
|
</choose>
|
|
|
|
|
<if test = "params.startDate != null and params.startDate != ''" >
|
|
|
|
|
<if test="params.startDate != null and params.startDate != ''">
|
|
|
|
|
AND tmb.create_date >= #{params.startDate}
|
|
|
|
|
</if>
|
|
|
|
|
<if test = "params.endDate != null and params.endDate != ''" >
|
|
|
|
|
<if test="params.endDate != null and params.endDate != ''">
|
|
|
|
|
AND #{params.endDate} >= tmb.create_date
|
|
|
|
|
</if>
|
|
|
|
|
<if test = "params.provideDept != null and params.provideDept != ''" >
|
|
|
|
|
<if test="params.provideDept != null and params.provideDept != ''">
|
|
|
|
|
AND 1067246875800000066 = #{params.provideDept}
|
|
|
|
|
</if>
|
|
|
|
|
<if test = "params.applyDept != null and params.applyDept != ''" >
|
|
|
|
|
<if test="params.applyDept != null and params.applyDept != ''">
|
|
|
|
|
AND tmb.dept LIKE CONCAT('%', #{params.applyDept} ,'%')
|
|
|
|
|
</if>
|
|
|
|
|
<if test = "params.resourceName != null and params.resourceName != ''" >
|
|
|
|
|
<if test="params.resourceName != null and params.resourceName != ''">
|
|
|
|
|
AND tm.NAME LIKE CONCAT('%', #{params.resourceName} ,'%')
|
|
|
|
|
</if>
|
|
|
|
|
<if test = "params.resourceType != null and params.resourceType != ''" >
|
|
|
|
|
<if test="params.resourceType != null and params.resourceType != ''">
|
|
|
|
|
AND '会客厅' = #{params.resourceType}
|
|
|
|
|
</if>
|
|
|
|
|
ORDER BY applyDate DESC
|
|
|
|
@ -453,7 +457,8 @@
|
|
|
|
|
t_ability_application taa
|
|
|
|
|
LEFT JOIN tb_data_resource tdr ON taa.resource_id = tdr.id
|
|
|
|
|
LEFT JOIN sys_dept sd ON tdr.dept_id = sd.id
|
|
|
|
|
LEFT JOIN ( SELECT data_resource_id, attr_type, attr_value FROM tb_data_attr tda WHERE del_flag = 0 AND attr_type = '组件类型' ) attr ON tdr.id = attr.data_resource_id
|
|
|
|
|
LEFT JOIN ( SELECT data_resource_id, attr_type, attr_value FROM tb_data_attr tda WHERE del_flag = 0 AND
|
|
|
|
|
attr_type = '组件类型' ) attr ON tdr.id = attr.data_resource_id
|
|
|
|
|
WHERE
|
|
|
|
|
1 = 1
|
|
|
|
|
AND tdr.del_flag = 0
|
|
|
|
@ -469,23 +474,24 @@
|
|
|
|
|
</choose>
|
|
|
|
|
AND taa.del_flag = 0
|
|
|
|
|
AND tdr.del_flag = 0
|
|
|
|
|
<if test = "params.startDate != null and params.startDate != ''" >
|
|
|
|
|
<if test="params.startDate != null and params.startDate != ''">
|
|
|
|
|
AND taa.create_date >= #{params.startDate}
|
|
|
|
|
</if>
|
|
|
|
|
<if test = "params.endDate != null and params.endDate != ''" >
|
|
|
|
|
<if test="params.endDate != null and params.endDate != ''">
|
|
|
|
|
AND #{params.endDate} >= taa.create_date
|
|
|
|
|
</if>
|
|
|
|
|
<if test = "params.provideDept != null and params.provideDept != ''" >
|
|
|
|
|
<if test="params.provideDept != null and params.provideDept != ''">
|
|
|
|
|
AND sd.id = #{params.provideDept}
|
|
|
|
|
</if>
|
|
|
|
|
<if test = "params.applyDept != null and params.applyDept != ''" >
|
|
|
|
|
<if test="params.applyDept != null and params.applyDept != ''">
|
|
|
|
|
AND taa.unit LIKE CONCAT('%', #{params.applyDept} ,'%')
|
|
|
|
|
</if>
|
|
|
|
|
<if test = "params.resourceName != null and params.resourceName != ''" >
|
|
|
|
|
<if test="params.resourceName != null and params.resourceName != ''">
|
|
|
|
|
AND tdr.NAME LIKE CONCAT('%', #{params.resourceName} ,'%')
|
|
|
|
|
</if>
|
|
|
|
|
<if test = "params.resourceType != null and params.resourceType != ''" >
|
|
|
|
|
AND ( CASE tdr.type WHEN '应用资源' THEN tdr.type WHEN '组件服务' THEN attr.attr_value ELSE tdr.type END ) = #{params.resourceType}
|
|
|
|
|
<if test="params.resourceType != null and params.resourceType != ''">
|
|
|
|
|
AND ( CASE tdr.type WHEN '应用资源' THEN tdr.type WHEN '组件服务' THEN attr.attr_value ELSE tdr.type END ) =
|
|
|
|
|
#{params.resourceType}
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
|
|
UNION ALL
|
|
|
|
@ -507,22 +513,22 @@
|
|
|
|
|
AND tmb.state IN (0, 2)
|
|
|
|
|
</otherwise>
|
|
|
|
|
</choose>
|
|
|
|
|
<if test = "params.startDate != null and params.startDate != ''" >
|
|
|
|
|
<if test="params.startDate != null and params.startDate != ''">
|
|
|
|
|
AND tmb.create_date >= #{params.startDate}
|
|
|
|
|
</if>
|
|
|
|
|
<if test = "params.endDate != null and params.endDate != ''" >
|
|
|
|
|
<if test="params.endDate != null and params.endDate != ''">
|
|
|
|
|
AND #{params.endDate} >= tmb.create_date
|
|
|
|
|
</if>
|
|
|
|
|
<if test = "params.provideDept != null and params.provideDept != ''" >
|
|
|
|
|
<if test="params.provideDept != null and params.provideDept != ''">
|
|
|
|
|
AND 1067246875800000066 = #{params.provideDept}
|
|
|
|
|
</if>
|
|
|
|
|
<if test = "params.applyDept != null and params.applyDept != ''" >
|
|
|
|
|
<if test="params.applyDept != null and params.applyDept != ''">
|
|
|
|
|
AND tmb.dept LIKE CONCAT('%', #{params.applyDept} ,'%')
|
|
|
|
|
</if>
|
|
|
|
|
<if test = "params.resourceName != null and params.resourceName != ''" >
|
|
|
|
|
<if test="params.resourceName != null and params.resourceName != ''">
|
|
|
|
|
AND tm.NAME LIKE CONCAT('%', #{params.resourceName} ,'%')
|
|
|
|
|
</if>
|
|
|
|
|
<if test = "params.resourceType != null and params.resourceType != ''" >
|
|
|
|
|
<if test="params.resourceType != null and params.resourceType != ''">
|
|
|
|
|
AND '会客厅' = #{params.resourceType}
|
|
|
|
|
</if>
|
|
|
|
|
) temp
|
|
|
|
@ -532,7 +538,8 @@
|
|
|
|
|
SELECT
|
|
|
|
|
taa.id,
|
|
|
|
|
tdr.NAME AS "resourceName",
|
|
|
|
|
( CASE tdr.type WHEN '应用资源' THEN tdr.type WHEN '组件服务' THEN attr.attr_value ELSE tdr.type END ) AS "resourceType",
|
|
|
|
|
( CASE tdr.type WHEN '应用资源' THEN tdr.type WHEN '组件服务' THEN attr.attr_value ELSE tdr.type END ) AS
|
|
|
|
|
"resourceType",
|
|
|
|
|
sd.NAME AS "provideDept",
|
|
|
|
|
taa.unit AS "applyDept",
|
|
|
|
|
date_format(taa.create_date, "%Y-%m-%d %h:%i:%s") AS "applyDate",
|
|
|
|
@ -542,7 +549,8 @@
|
|
|
|
|
t_ability_application taa
|
|
|
|
|
LEFT JOIN tb_data_resource tdr ON taa.resource_id = tdr.id
|
|
|
|
|
LEFT JOIN sys_dept sd ON tdr.dept_id = sd.id
|
|
|
|
|
LEFT JOIN ( SELECT data_resource_id, attr_type, attr_value FROM tb_data_attr tda WHERE del_flag = 0 AND attr_type = '组件类型' ) attr ON tdr.id = attr.data_resource_id
|
|
|
|
|
LEFT JOIN ( SELECT data_resource_id, attr_type, attr_value FROM tb_data_attr tda WHERE del_flag = 0 AND
|
|
|
|
|
attr_type = '组件类型' ) attr ON tdr.id = attr.data_resource_id
|
|
|
|
|
WHERE
|
|
|
|
|
1 = 1
|
|
|
|
|
AND tdr.del_flag = 0
|
|
|
|
@ -558,23 +566,24 @@
|
|
|
|
|
</choose>
|
|
|
|
|
AND taa.del_flag = 0
|
|
|
|
|
AND tdr.del_flag = 0
|
|
|
|
|
<if test = "params.startDate != null and params.startDate != ''" >
|
|
|
|
|
<if test="params.startDate != null and params.startDate != ''">
|
|
|
|
|
AND taa.create_date >= #{params.startDate}
|
|
|
|
|
</if>
|
|
|
|
|
<if test = "params.endDate != null and params.endDate != ''" >
|
|
|
|
|
<if test="params.endDate != null and params.endDate != ''">
|
|
|
|
|
AND #{params.endDate} >= taa.create_date
|
|
|
|
|
</if>
|
|
|
|
|
<if test = "params.provideDept != null and params.provideDept != ''" >
|
|
|
|
|
<if test="params.provideDept != null and params.provideDept != ''">
|
|
|
|
|
AND sd.id = #{params.provideDept}
|
|
|
|
|
</if>
|
|
|
|
|
<if test = "params.applyDept != null and params.applyDept != ''" >
|
|
|
|
|
<if test="params.applyDept != null and params.applyDept != ''">
|
|
|
|
|
AND taa.unit LIKE CONCAT('%', #{params.applyDept} ,'%')
|
|
|
|
|
</if>
|
|
|
|
|
<if test = "params.resourceName != null and params.resourceName != ''" >
|
|
|
|
|
<if test="params.resourceName != null and params.resourceName != ''">
|
|
|
|
|
AND tdr.NAME LIKE CONCAT('%', #{params.resourceName} ,'%')
|
|
|
|
|
</if>
|
|
|
|
|
<if test = "params.resourceType != null and params.resourceType != ''" >
|
|
|
|
|
AND ( CASE tdr.type WHEN '应用资源' THEN tdr.type WHEN '组件服务' THEN attr.attr_value ELSE tdr.type END ) = #{params.resourceType}
|
|
|
|
|
<if test="params.resourceType != null and params.resourceType != ''">
|
|
|
|
|
AND ( CASE tdr.type WHEN '应用资源' THEN tdr.type WHEN '组件服务' THEN attr.attr_value ELSE tdr.type END ) =
|
|
|
|
|
#{params.resourceType}
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
|
|
UNION ALL
|
|
|
|
@ -604,22 +613,22 @@
|
|
|
|
|
AND tmb.state IN (0, 2)
|
|
|
|
|
</otherwise>
|
|
|
|
|
</choose>
|
|
|
|
|
<if test = "params.startDate != null and params.startDate != ''" >
|
|
|
|
|
<if test="params.startDate != null and params.startDate != ''">
|
|
|
|
|
AND tmb.create_date >= #{params.startDate}
|
|
|
|
|
</if>
|
|
|
|
|
<if test = "params.endDate != null and params.endDate != ''" >
|
|
|
|
|
<if test="params.endDate != null and params.endDate != ''">
|
|
|
|
|
AND #{params.endDate} >= tmb.create_date
|
|
|
|
|
</if>
|
|
|
|
|
<if test = "params.provideDept != null and params.provideDept != ''" >
|
|
|
|
|
<if test="params.provideDept != null and params.provideDept != ''">
|
|
|
|
|
AND 1067246875800000066 = #{params.provideDept}
|
|
|
|
|
</if>
|
|
|
|
|
<if test = "params.applyDept != null and params.applyDept != ''" >
|
|
|
|
|
<if test="params.applyDept != null and params.applyDept != ''">
|
|
|
|
|
AND tmb.dept LIKE CONCAT('%', #{params.applyDept} ,'%')
|
|
|
|
|
</if>
|
|
|
|
|
<if test = "params.resourceName != null and params.resourceName != ''" >
|
|
|
|
|
<if test="params.resourceName != null and params.resourceName != ''">
|
|
|
|
|
AND tm.NAME LIKE CONCAT('%', #{params.resourceName} ,'%')
|
|
|
|
|
</if>
|
|
|
|
|
<if test = "params.resourceType != null and params.resourceType != ''" >
|
|
|
|
|
<if test="params.resourceType != null and params.resourceType != ''">
|
|
|
|
|
AND '会客厅' = #{params.resourceType}
|
|
|
|
|
</if>
|
|
|
|
|
ORDER BY applyDate DESC
|
|
|
|
@ -633,7 +642,8 @@
|
|
|
|
|
t_ability_application taa
|
|
|
|
|
LEFT JOIN tb_data_resource tdr ON taa.resource_id = tdr.id
|
|
|
|
|
LEFT JOIN sys_dept sd ON tdr.dept_id = sd.id
|
|
|
|
|
LEFT JOIN ( SELECT data_resource_id, attr_type, attr_value FROM tb_data_attr tda WHERE del_flag = 0 AND attr_type = '组件类型' ) attr ON tdr.id = attr.data_resource_id
|
|
|
|
|
LEFT JOIN ( SELECT data_resource_id, attr_type, attr_value FROM tb_data_attr tda WHERE del_flag = 0 AND
|
|
|
|
|
attr_type = '组件类型' ) attr ON tdr.id = attr.data_resource_id
|
|
|
|
|
WHERE
|
|
|
|
|
1 = 1
|
|
|
|
|
AND tdr.del_flag = 0
|
|
|
|
@ -649,23 +659,24 @@
|
|
|
|
|
</choose>
|
|
|
|
|
AND taa.del_flag = 0
|
|
|
|
|
AND tdr.del_flag = 0
|
|
|
|
|
<if test = "params.startDate != null and params.startDate != ''" >
|
|
|
|
|
<if test="params.startDate != null and params.startDate != ''">
|
|
|
|
|
AND taa.create_date >= #{params.startDate}
|
|
|
|
|
</if>
|
|
|
|
|
<if test = "params.endDate != null and params.endDate != ''" >
|
|
|
|
|
<if test="params.endDate != null and params.endDate != ''">
|
|
|
|
|
AND #{params.endDate} >= taa.create_date
|
|
|
|
|
</if>
|
|
|
|
|
<if test = "params.provideDept != null and params.provideDept != ''" >
|
|
|
|
|
<if test="params.provideDept != null and params.provideDept != ''">
|
|
|
|
|
AND sd.id = #{params.provideDept}
|
|
|
|
|
</if>
|
|
|
|
|
<if test = "params.applyDept != null and params.applyDept != ''" >
|
|
|
|
|
<if test="params.applyDept != null and params.applyDept != ''">
|
|
|
|
|
AND taa.unit LIKE CONCAT('%', #{params.applyDept} ,'%')
|
|
|
|
|
</if>
|
|
|
|
|
<if test = "params.resourceName != null and params.resourceName != ''" >
|
|
|
|
|
<if test="params.resourceName != null and params.resourceName != ''">
|
|
|
|
|
AND tdr.NAME LIKE CONCAT('%', #{params.resourceName} ,'%')
|
|
|
|
|
</if>
|
|
|
|
|
<if test = "params.resourceType != null and params.resourceType != ''" >
|
|
|
|
|
AND ( CASE tdr.type WHEN '应用资源' THEN tdr.type WHEN '组件服务' THEN attr.attr_value ELSE tdr.type END ) = #{params.resourceType}
|
|
|
|
|
<if test="params.resourceType != null and params.resourceType != ''">
|
|
|
|
|
AND ( CASE tdr.type WHEN '应用资源' THEN tdr.type WHEN '组件服务' THEN attr.attr_value ELSE tdr.type END ) =
|
|
|
|
|
#{params.resourceType}
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
|
|
UNION ALL
|
|
|
|
@ -689,22 +700,22 @@
|
|
|
|
|
AND tmb.state IN (0, 2)
|
|
|
|
|
</otherwise>
|
|
|
|
|
</choose>
|
|
|
|
|
<if test = "params.startDate != null and params.startDate != ''" >
|
|
|
|
|
<if test="params.startDate != null and params.startDate != ''">
|
|
|
|
|
AND tmb.create_date >= #{params.startDate}
|
|
|
|
|
</if>
|
|
|
|
|
<if test = "params.endDate != null and params.endDate != ''" >
|
|
|
|
|
<if test="params.endDate != null and params.endDate != ''">
|
|
|
|
|
AND #{params.endDate} >= tmb.create_date
|
|
|
|
|
</if>
|
|
|
|
|
<if test = "params.provideDept != null and params.provideDept != ''" >
|
|
|
|
|
<if test="params.provideDept != null and params.provideDept != ''">
|
|
|
|
|
AND 1067246875800000066 = #{params.provideDept}
|
|
|
|
|
</if>
|
|
|
|
|
<if test = "params.applyDept != null and params.applyDept != ''" >
|
|
|
|
|
<if test="params.applyDept != null and params.applyDept != ''">
|
|
|
|
|
AND tmb.dept LIKE CONCAT('%', #{params.applyDept} ,'%')
|
|
|
|
|
</if>
|
|
|
|
|
<if test = "params.resourceName != null and params.resourceName != ''" >
|
|
|
|
|
<if test="params.resourceName != null and params.resourceName != ''">
|
|
|
|
|
AND tm.NAME LIKE CONCAT('%', #{params.resourceName} ,'%')
|
|
|
|
|
</if>
|
|
|
|
|
<if test = "params.resourceType != null and params.resourceType != ''" >
|
|
|
|
|
<if test="params.resourceType != null and params.resourceType != ''">
|
|
|
|
|
AND '会客厅' = #{params.resourceType}
|
|
|
|
|
</if>
|
|
|
|
|
) temp
|
|
|
|
@ -982,9 +993,11 @@
|
|
|
|
|
( SELECT id, NAME, sort FROM sys_region WHERE tree_level = 3 AND 9 >= sort ) srg
|
|
|
|
|
LEFT JOIN sys_dept sd ON sd.district = srg.id
|
|
|
|
|
LEFT JOIN tb_data_resource tdr ON tdr.dept_id = sd.id
|
|
|
|
|
LEFT JOIN (SELECT resource_id, SUM(apply_price) AS "apply_price", COUNT(id) AS "applyCount" FROM t_ability_application taa WHERE
|
|
|
|
|
LEFT JOIN (SELECT resource_id, SUM(apply_price) AS "apply_price", COUNT(id) AS "applyCount" FROM
|
|
|
|
|
t_ability_application taa WHERE
|
|
|
|
|
taa.del_flag = 0
|
|
|
|
|
AND taa.approve_status = '通过' AND (taa.camera_list IS NULL OR taa.camera_list = '') GROUP BY resource_id ) taa ON taa.resource_id = tdr.id
|
|
|
|
|
AND taa.approve_status = '通过' AND (taa.camera_list IS NULL OR taa.camera_list = '') GROUP BY resource_id ) taa
|
|
|
|
|
ON taa.resource_id = tdr.id
|
|
|
|
|
GROUP BY
|
|
|
|
|
srg.id
|
|
|
|
|
ORDER BY srg.sort
|
|
|
|
|