sql提交
This commit is contained in:
parent
62f2330ffb
commit
3fedcde616
|
|
@ -934,4 +934,29 @@
|
||||||
<select id="selectTaskStatus" resultType="java.lang.Integer">
|
<select id="selectTaskStatus" resultType="java.lang.Integer">
|
||||||
select task_status from tm_task where task_id = #{taskId}
|
select task_status from tm_task where task_id = #{taskId}
|
||||||
</select>
|
</select>
|
||||||
|
<select id="selectNumByTypeId" resultType="java.lang.Integer">
|
||||||
|
SELECT
|
||||||
|
ROUND(SUM( res.auditNum )- SUM( res.backNum ),0) AS backNum
|
||||||
|
FROM
|
||||||
|
(
|
||||||
|
SELECT
|
||||||
|
bad.audit_num AS auditNum,
|
||||||
|
0 AS backNum
|
||||||
|
FROM
|
||||||
|
back_apply_details bad
|
||||||
|
WHERE
|
||||||
|
bad.parent_id = #{parentId}
|
||||||
|
AND bad.type_id = #{typeId} UNION
|
||||||
|
SELECT
|
||||||
|
0 AS auditNum,
|
||||||
|
SUM(
|
||||||
|
IFNULL( bcd.back_num, 0 )) AS backNum
|
||||||
|
FROM
|
||||||
|
back_check_details bcd
|
||||||
|
WHERE
|
||||||
|
bcd.parent_id = #{parentId}
|
||||||
|
AND bcd.type_id = #{typeId}
|
||||||
|
) res
|
||||||
|
HAVING backNum > -1
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
Loading…
Reference in New Issue