You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

56 lines
2.3 KiB

4 years ago
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.daqing.financial.guarantee.mapper.DgEfficiencyMapper">
4 years ago
<select id="queryList" resultType="com.daqing.framework.domain.guarantee.po.DgTeamEfficiencyPO">
SELECT p.business_id AS business_id,p.process_id AS process_id,p.department_id AS department_id,p.create_time AS create_time
FROM dg_audit_process AS p
LEFT JOIN dg_apply_amount_info AS a
ON p.business_id = a.id
LEFT JOIN dg_business_process_status AS s
ON p.business_id = s.business_id
WHERE 1 = 1
<if test="et.flowStatus != null">
AND s.business_status = #{et.flowStatus}
</if>
<if test="et.startTime != null and et.startTime != ''">
AND a.create_time &gt;= #{et.startTime}
</if>
<if test="et.endTime != null and et.endTime != ''">
AND a.create_time &lt;= #{et.endTime}
</if>
ORDER BY p.create_time ASC
4 years ago
</select>
4 years ago
<select id="queryBusinessId" resultType="integer">
SELECT p.business_id AS business_id
FROM dg_audit_process AS p
LEFT JOIN dg_apply_amount_info AS a
ON p.business_id = a.id
LEFT JOIN dg_business_process_status AS s
ON p.business_id = s.business_id
WHERE 1 = 1
<if test="et.flowStatus != null">
AND s.business_status = #{et.flowStatus}
</if>
<if test="et.startTime != null and et.startTime != ''">
AND a.create_time &gt;= #{et.startTime}
</if>
<if test="et.endTime != null and et.endTime != ''">
AND a.create_time &lt;= #{et.endTime}
</if>
GROUP BY business_id
ORDER BY p.create_time ASC
4 years ago
</select>
4 years ago
<!-- 统计不同业务状态下业务的数量 -->
<select id="getBusinessCount" resultType="java.util.Map">
SELECT
SUM(CASE WHEN (business_status = 0) THEN 1 ELSE 0 END) AS '0',
SUM(CASE WHEN (business_status = 1) THEN 1 ELSE 0 END) AS '1',
SUM(CASE WHEN (business_status = 2) THEN 1 ELSE 0 END) AS '2',
SUM(CASE WHEN (business_status = 3) THEN 1 ELSE 0 END) AS '3'
FROM dg_business_process_status
</select>
4 years ago
</mapper>