|
|
@ -246,32 +246,42 @@
|
|
|
|
SELECT
|
|
|
|
SELECT
|
|
|
|
s.dwmc,
|
|
|
|
s.dwmc,
|
|
|
|
s.task_id,
|
|
|
|
s.task_id,
|
|
|
|
latest_create_time,
|
|
|
|
CURRENT_TIMESTAMP AS latest_create_time, -- 使用当前时间
|
|
|
|
b.task_deadline,
|
|
|
|
b.task_deadline,
|
|
|
|
SUM(total) AS total,
|
|
|
|
SUM(s.total) AS total,
|
|
|
|
SUM(checked) AS checked,
|
|
|
|
SUM(s.checked) AS checked,
|
|
|
|
|
|
|
|
COALESCE(SUM(s.returned), 0) AS shthcs,
|
|
|
|
|
|
|
|
ROUND(
|
|
|
|
CASE
|
|
|
|
CASE
|
|
|
|
WHEN SUM(returned) IS NULL OR SUM(returned) = 0 THEN 0
|
|
|
|
WHEN SUM(s.total) > 0 THEN
|
|
|
|
ELSE SUM(returned)
|
|
|
|
SUM(s.checked) * 100.0 / SUM(s.total)
|
|
|
|
END AS shthcs,
|
|
|
|
|
|
|
|
ROUND(CASE
|
|
|
|
|
|
|
|
WHEN SUM(total) > 0 THEN SUM(checked) * 100 / SUM(total)
|
|
|
|
|
|
|
|
ELSE 0
|
|
|
|
ELSE 0
|
|
|
|
END, 2) AS checkedRatio,
|
|
|
|
END,
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
|
) AS checkedRatio,
|
|
|
|
CASE
|
|
|
|
CASE
|
|
|
|
WHEN ROUND(CASE
|
|
|
|
WHEN ROUND(
|
|
|
|
WHEN SUM(total) > 0 THEN SUM(checked) * 100 / SUM(total)
|
|
|
|
CASE
|
|
|
|
|
|
|
|
WHEN SUM(s.total) > 0 THEN
|
|
|
|
|
|
|
|
SUM(s.checked) * 100.0 / SUM(s.total)
|
|
|
|
ELSE 0
|
|
|
|
ELSE 0
|
|
|
|
END, 2) = 100
|
|
|
|
END,
|
|
|
|
AND MAX(latest_create_time) < b.task_deadline THEN 2
|
|
|
|
2
|
|
|
|
WHEN ROUND(CASE
|
|
|
|
) = 100
|
|
|
|
WHEN SUM(total) > 0 THEN SUM(checked) * 100 / SUM(total)
|
|
|
|
AND CURRENT_TIMESTAMP < b.task_deadline THEN 2
|
|
|
|
|
|
|
|
WHEN ROUND(
|
|
|
|
|
|
|
|
CASE
|
|
|
|
|
|
|
|
WHEN SUM(s.total) > 0 THEN
|
|
|
|
|
|
|
|
SUM(s.checked) * 100.0 / SUM(s.total)
|
|
|
|
ELSE 0
|
|
|
|
ELSE 0
|
|
|
|
END, 2) = 100
|
|
|
|
END,
|
|
|
|
AND MAX(latest_create_time) >= b.task_deadline THEN 3
|
|
|
|
2
|
|
|
|
|
|
|
|
) = 100
|
|
|
|
|
|
|
|
AND CURRENT_TIMESTAMP >= b.task_deadline THEN 3
|
|
|
|
ELSE 1
|
|
|
|
ELSE 1
|
|
|
|
END AS taskStatus
|
|
|
|
END AS taskStatus
|
|
|
|
FROM (
|
|
|
|
FROM
|
|
|
|
|
|
|
|
(
|
|
|
|
SELECT
|
|
|
|
SELECT
|
|
|
|
dwmc,
|
|
|
|
dwmc,
|
|
|
|
COUNT(*) AS total,
|
|
|
|
COUNT(*) AS total,
|
|
|
@ -392,8 +402,8 @@
|
|
|
|
</where>
|
|
|
|
</where>
|
|
|
|
GROUP BY
|
|
|
|
GROUP BY
|
|
|
|
s.dwmc ,
|
|
|
|
s.dwmc ,
|
|
|
|
s.task_id,
|
|
|
|
s.task_id
|
|
|
|
s.latest_create_time
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</select>
|
|
|
|
</select>
|
|
|
|
<select id="findByTaskId" resultType="com.ruoyi.tc.entity.response.AssetTaskStatusResponse">
|
|
|
|
<select id="findByTaskId" resultType="com.ruoyi.tc.entity.response.AssetTaskStatusResponse">
|
|
|
@ -541,32 +551,42 @@
|
|
|
|
SELECT
|
|
|
|
SELECT
|
|
|
|
s.dwmc,
|
|
|
|
s.dwmc,
|
|
|
|
s.task_id,
|
|
|
|
s.task_id,
|
|
|
|
latest_create_time,
|
|
|
|
CURRENT_TIMESTAMP AS latest_create_time, -- 使用当前时间
|
|
|
|
b.task_deadline,
|
|
|
|
b.task_deadline,
|
|
|
|
SUM(total) AS total,
|
|
|
|
SUM(s.total) AS total,
|
|
|
|
SUM(checked) AS checked,
|
|
|
|
SUM(s.checked) AS checked,
|
|
|
|
|
|
|
|
COALESCE(SUM(s.returned), 0) AS shthcs,
|
|
|
|
|
|
|
|
ROUND(
|
|
|
|
CASE
|
|
|
|
CASE
|
|
|
|
WHEN SUM(returned) IS NULL OR SUM(returned) = 0 THEN 0
|
|
|
|
WHEN SUM(s.total) > 0 THEN
|
|
|
|
ELSE SUM(returned)
|
|
|
|
SUM(s.checked) * 100.0 / SUM(s.total)
|
|
|
|
END AS shthcs,
|
|
|
|
|
|
|
|
ROUND(CASE
|
|
|
|
|
|
|
|
WHEN SUM(total) > 0 THEN SUM(checked) * 100 / SUM(total)
|
|
|
|
|
|
|
|
ELSE 0
|
|
|
|
ELSE 0
|
|
|
|
END, 2) AS checkedRatio,
|
|
|
|
END,
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
|
) AS checkedRatio,
|
|
|
|
CASE
|
|
|
|
CASE
|
|
|
|
WHEN ROUND(CASE
|
|
|
|
WHEN ROUND(
|
|
|
|
WHEN SUM(total) > 0 THEN SUM(checked) * 100 / SUM(total)
|
|
|
|
CASE
|
|
|
|
|
|
|
|
WHEN SUM(s.total) > 0 THEN
|
|
|
|
|
|
|
|
SUM(s.checked) * 100.0 / SUM(s.total)
|
|
|
|
ELSE 0
|
|
|
|
ELSE 0
|
|
|
|
END, 2) = 100
|
|
|
|
END,
|
|
|
|
AND MAX(latest_create_time) < b.task_deadline THEN 2
|
|
|
|
2
|
|
|
|
WHEN ROUND(CASE
|
|
|
|
) = 100
|
|
|
|
WHEN SUM(total) > 0 THEN SUM(checked) * 100 / SUM(total)
|
|
|
|
AND CURRENT_TIMESTAMP < b.task_deadline THEN 2
|
|
|
|
|
|
|
|
WHEN ROUND(
|
|
|
|
|
|
|
|
CASE
|
|
|
|
|
|
|
|
WHEN SUM(s.total) > 0 THEN
|
|
|
|
|
|
|
|
SUM(s.checked) * 100.0 / SUM(s.total)
|
|
|
|
ELSE 0
|
|
|
|
ELSE 0
|
|
|
|
END, 2) = 100
|
|
|
|
END,
|
|
|
|
AND MAX(latest_create_time) >= b.task_deadline THEN 3
|
|
|
|
2
|
|
|
|
|
|
|
|
) = 100
|
|
|
|
|
|
|
|
AND CURRENT_TIMESTAMP >= b.task_deadline THEN 3
|
|
|
|
ELSE 1
|
|
|
|
ELSE 1
|
|
|
|
END AS taskStatus
|
|
|
|
END AS taskStatus
|
|
|
|
FROM (
|
|
|
|
FROM
|
|
|
|
|
|
|
|
(
|
|
|
|
SELECT
|
|
|
|
SELECT
|
|
|
|
dwmc,
|
|
|
|
dwmc,
|
|
|
|
COUNT(*) AS total,
|
|
|
|
COUNT(*) AS total,
|
|
|
@ -693,39 +713,50 @@
|
|
|
|
</select>
|
|
|
|
</select>
|
|
|
|
<select id="dwHcBl" resultType="com.ruoyi.tc.entity.response.AssetdwHcBlResponse"
|
|
|
|
<select id="dwHcBl" resultType="com.ruoyi.tc.entity.response.AssetdwHcBlResponse"
|
|
|
|
parameterType="com.ruoyi.tc.entity.request.AssetdwHcRequest">
|
|
|
|
parameterType="com.ruoyi.tc.entity.request.AssetdwHcRequest">
|
|
|
|
|
|
|
|
select count(*) as count ,taskStatus from (
|
|
|
|
SELECT
|
|
|
|
SELECT
|
|
|
|
taskStatus,
|
|
|
|
count(*) AS count,
|
|
|
|
COUNT(*) AS count -- Count of records for each taskStatus
|
|
|
|
g.taskStatus
|
|
|
|
FROM (
|
|
|
|
FROM
|
|
|
|
SELECT
|
|
|
|
( SELECT
|
|
|
|
s.dwmc,
|
|
|
|
s.dwmc,
|
|
|
|
s.task_id,
|
|
|
|
s.task_id,
|
|
|
|
latest_create_time,
|
|
|
|
CURRENT_TIMESTAMP AS latest_create_time, -- 使用当前时间
|
|
|
|
b.task_deadline,
|
|
|
|
b.task_deadline,
|
|
|
|
SUM(total) AS total,
|
|
|
|
SUM(s.total) AS total,
|
|
|
|
SUM(checked) AS checked,
|
|
|
|
SUM(s.checked) AS checked,
|
|
|
|
|
|
|
|
COALESCE(SUM(s.returned), 0) AS shthcs,
|
|
|
|
|
|
|
|
ROUND(
|
|
|
|
CASE
|
|
|
|
CASE
|
|
|
|
WHEN SUM(returned) IS NULL OR SUM(returned) = 0 THEN 0
|
|
|
|
WHEN SUM(s.total) > 0 THEN
|
|
|
|
ELSE SUM(returned)
|
|
|
|
SUM(s.checked) * 100.0 / SUM(s.total)
|
|
|
|
END AS shthcs,
|
|
|
|
|
|
|
|
ROUND(CASE
|
|
|
|
|
|
|
|
WHEN SUM(total) > 0 THEN SUM(checked) * 100 / SUM(total)
|
|
|
|
|
|
|
|
ELSE 0
|
|
|
|
ELSE 0
|
|
|
|
END, 2) AS checkedRatio,
|
|
|
|
END,
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
|
) AS checkedRatio,
|
|
|
|
CASE
|
|
|
|
CASE
|
|
|
|
WHEN ROUND(CASE
|
|
|
|
WHEN ROUND(
|
|
|
|
WHEN SUM(total) > 0 THEN SUM(checked) * 100 / SUM(total)
|
|
|
|
CASE
|
|
|
|
|
|
|
|
WHEN SUM(s.total) > 0 THEN
|
|
|
|
|
|
|
|
SUM(s.checked) * 100.0 / SUM(s.total)
|
|
|
|
ELSE 0
|
|
|
|
ELSE 0
|
|
|
|
END, 2) = 100
|
|
|
|
END,
|
|
|
|
AND MAX(latest_create_time) < b.task_deadline THEN 2
|
|
|
|
2
|
|
|
|
WHEN ROUND(CASE
|
|
|
|
) = 100
|
|
|
|
WHEN SUM(total) > 0 THEN SUM(checked) * 100 / SUM(total)
|
|
|
|
AND CURRENT_TIMESTAMP < b.task_deadline THEN 2
|
|
|
|
|
|
|
|
WHEN ROUND(
|
|
|
|
|
|
|
|
CASE
|
|
|
|
|
|
|
|
WHEN SUM(s.total) > 0 THEN
|
|
|
|
|
|
|
|
SUM(s.checked) * 100.0 / SUM(s.total)
|
|
|
|
ELSE 0
|
|
|
|
ELSE 0
|
|
|
|
END, 2) = 100
|
|
|
|
END,
|
|
|
|
AND MAX(latest_create_time) >= b.task_deadline THEN 3
|
|
|
|
2
|
|
|
|
|
|
|
|
) = 100
|
|
|
|
|
|
|
|
AND CURRENT_TIMESTAMP >= b.task_deadline THEN 3
|
|
|
|
ELSE 1
|
|
|
|
ELSE 1
|
|
|
|
END AS taskStatus
|
|
|
|
END AS taskStatus
|
|
|
|
FROM (
|
|
|
|
FROM
|
|
|
|
|
|
|
|
(
|
|
|
|
SELECT
|
|
|
|
SELECT
|
|
|
|
dwmc,
|
|
|
|
dwmc,
|
|
|
|
COUNT(*) AS total,
|
|
|
|
COUNT(*) AS total,
|
|
|
@ -737,6 +768,9 @@
|
|
|
|
FROM
|
|
|
|
FROM
|
|
|
|
asset_current_cp
|
|
|
|
asset_current_cp
|
|
|
|
<where>
|
|
|
|
<where>
|
|
|
|
|
|
|
|
<if test="req.dwmc!=null and req.dwmc!='' ">
|
|
|
|
|
|
|
|
and dwmc like concat('%',#{req.dwmc},'%')
|
|
|
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
|
|
|
|
<if test="req.taskId!=null and req.taskId!='' ">
|
|
|
|
<if test="req.taskId!=null and req.taskId!='' ">
|
|
|
|
and task_id =#{req.taskId}
|
|
|
|
and task_id =#{req.taskId}
|
|
|
@ -757,6 +791,10 @@
|
|
|
|
FROM
|
|
|
|
FROM
|
|
|
|
asset_mini_programs_cp
|
|
|
|
asset_mini_programs_cp
|
|
|
|
<where>
|
|
|
|
<where>
|
|
|
|
|
|
|
|
<if test="req.dwmc!=null and req.dwmc!='' ">
|
|
|
|
|
|
|
|
and ssdw like concat('%',#{req.dwmc},'%')
|
|
|
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
|
|
|
|
<if test="req.taskId!=null and req.taskId!='' ">
|
|
|
|
<if test="req.taskId!=null and req.taskId!='' ">
|
|
|
|
and task_id =#{req.taskId}
|
|
|
|
and task_id =#{req.taskId}
|
|
|
|
</if>
|
|
|
|
</if>
|
|
|
@ -776,6 +814,10 @@
|
|
|
|
FROM
|
|
|
|
FROM
|
|
|
|
asset_app_cp
|
|
|
|
asset_app_cp
|
|
|
|
<where>
|
|
|
|
<where>
|
|
|
|
|
|
|
|
<if test="req.dwmc!=null and req.dwmc!='' ">
|
|
|
|
|
|
|
|
and ssdw like concat('%',#{req.dwmc},'%')
|
|
|
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
|
|
|
|
<if test="req.taskId!=null and req.taskId!='' ">
|
|
|
|
<if test="req.taskId!=null and req.taskId!='' ">
|
|
|
|
and task_id =#{req.taskId}
|
|
|
|
and task_id =#{req.taskId}
|
|
|
|
</if>
|
|
|
|
</if>
|
|
|
@ -793,6 +835,10 @@
|
|
|
|
FROM
|
|
|
|
FROM
|
|
|
|
asset_official_account_cp
|
|
|
|
asset_official_account_cp
|
|
|
|
<where>
|
|
|
|
<where>
|
|
|
|
|
|
|
|
<if test="req.dwmc!=null and req.dwmc!='' ">
|
|
|
|
|
|
|
|
and ssdw like concat('%',#{req.dwmc},'%')
|
|
|
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
|
|
|
|
<if test="req.taskId!=null and req.taskId!='' ">
|
|
|
|
<if test="req.taskId!=null and req.taskId!='' ">
|
|
|
|
and task_id =#{req.taskId}
|
|
|
|
and task_id =#{req.taskId}
|
|
|
|
</if>
|
|
|
|
</if>
|
|
|
@ -812,6 +858,10 @@
|
|
|
|
FROM
|
|
|
|
FROM
|
|
|
|
asset_email_cp
|
|
|
|
asset_email_cp
|
|
|
|
<where>
|
|
|
|
<where>
|
|
|
|
|
|
|
|
<if test="req.dwmc!=null and req.dwmc!='' ">
|
|
|
|
|
|
|
|
and ssdw like concat('%',#{req.dwmc},'%')
|
|
|
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
|
|
|
|
<if test="req.taskId!=null and req.taskId!='' ">
|
|
|
|
<if test="req.taskId!=null and req.taskId!='' ">
|
|
|
|
and task_id =#{req.taskId}
|
|
|
|
and task_id =#{req.taskId}
|
|
|
|
</if>
|
|
|
|
</if>
|
|
|
@ -820,15 +870,19 @@
|
|
|
|
ssdw,
|
|
|
|
ssdw,
|
|
|
|
task_id
|
|
|
|
task_id
|
|
|
|
) AS s left join asset_task b on s.task_id=b.id
|
|
|
|
) AS s left join asset_task b on s.task_id=b.id
|
|
|
|
|
|
|
|
<where>
|
|
|
|
|
|
|
|
<if test="req.taskStatus != null and req.taskStatus != ''">
|
|
|
|
|
|
|
|
b.task_status = #{req.taskStatus}
|
|
|
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
</where>
|
|
|
|
GROUP BY
|
|
|
|
GROUP BY
|
|
|
|
s.dwmc ,
|
|
|
|
s.dwmc ,
|
|
|
|
s.task_id,
|
|
|
|
s.task_id
|
|
|
|
s.latest_create_time
|
|
|
|
) g
|
|
|
|
)AS aggregated_results
|
|
|
|
|
|
|
|
GROUP BY
|
|
|
|
GROUP BY
|
|
|
|
|
|
|
|
dwmc,
|
|
|
|
taskStatus
|
|
|
|
taskStatus
|
|
|
|
ORDER BY
|
|
|
|
)f group by taskStatus
|
|
|
|
taskStatus
|
|
|
|
|
|
|
|
</select>
|
|
|
|
</select>
|
|
|
|
<update id="xcxsh"
|
|
|
|
<update id="xcxsh"
|
|
|
|
parameterType="com.ruoyi.tc.entity.request.AssetCurrentShRequest">
|
|
|
|
parameterType="com.ruoyi.tc.entity.request.AssetCurrentShRequest">
|
|
|
|