|
|
|
<?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">
|
|
|
|
|
|
|
|
<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 >= #{et.startTime}
|
|
|
|
</if>
|
|
|
|
<if test="et.endTime != null and et.endTime != ''">
|
|
|
|
AND a.create_time <= #{et.endTime}
|
|
|
|
</if>
|
|
|
|
ORDER BY p.create_time ASC
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<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 >= #{et.startTime}
|
|
|
|
</if>
|
|
|
|
<if test="et.endTime != null and et.endTime != ''">
|
|
|
|
AND a.create_time <= #{et.endTime}
|
|
|
|
</if>
|
|
|
|
GROUP BY business_id
|
|
|
|
ORDER BY p.create_time ASC
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<!-- 统计不同业务状态下业务的数量 -->
|
|
|
|
<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>
|
|
|
|
|
|
|
|
</mapper>
|