|
|
|
@ -2,64 +2,45 @@ |
|
|
|
|
<!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"> |
|
|
|
|
|
|
|
|
|
<resultMap id="BaseResultMap" type="com.daqing.framework.domain.guarantee.DgApplyAmountInfo"> |
|
|
|
|
<id column="id" property="id" /> |
|
|
|
|
<result column="company_id" property="companyId" /> |
|
|
|
|
<result column="presenter_id" property="presenterId" /> |
|
|
|
|
<result column="apply_amount" property="applyAmount" /> |
|
|
|
|
<result column="apply_time" property="applyTime" /> |
|
|
|
|
<result column="bank" property="bank" /> |
|
|
|
|
<result column="amount_wide" property="amountWide" /> |
|
|
|
|
<result column="en_guarantee_measures" property="enGuaranteeMeasures" /> |
|
|
|
|
<result column="business_type" property="businessType" /> |
|
|
|
|
<result column="create_time" property="createTime" /> |
|
|
|
|
<result column="update_time" property="updateTime" /> |
|
|
|
|
</resultMap> |
|
|
|
|
|
|
|
|
|
<select id="teamList" parameterType="com.daqing.financial.guarantee.model.request.DgEfficiencyTeamRequest" resultType="com.daqing.framework.domain.guarantee.po.DgEfficiencyTeamPO"> |
|
|
|
|
SELECT c.id AS id,c.name AS name,a.presenter_id AS presenter_id,a.create_time AS create_time,a.,p.emp_name AS emp_name, |
|
|
|
|
p.status AS status,p.date_time AS date_time |
|
|
|
|
FROM dg_apply_amount_info AS a |
|
|
|
|
LEFT JOIN (SELECT apply_amount_info_id,emp_name,status,date_time FROM dg_audit_process WHERE (apply_amount_info_id,date_time) IN |
|
|
|
|
(SELECT apply_amount_info_id,MAX(date_time) FROM dg_audit_process GROUP BY apply_amount_info_id)) AS p |
|
|
|
|
ON a.id = p.apply_amount_info_id |
|
|
|
|
LEFT JOIN crms_customer AS c |
|
|
|
|
ON a.company_id = c.id |
|
|
|
|
WHERE c.del_or_not = 0 |
|
|
|
|
<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="personList" parameterType="com.daqing.financial.guarantee.model.request.DgEfficiencyPersonRequest" resultType="com.daqing.framework.domain.guarantee.po.DgEfficiencyPersonPO"> |
|
|
|
|
SELECT c.id AS id,c.name AS name,a.presenter_id AS presenter_id,a.create_time AS create_time,a.status AS flow_status, |
|
|
|
|
p.emp_name AS emp_name,p.status AS status,p.date_time AS date_time |
|
|
|
|
FROM dg_apply_amount_info AS a |
|
|
|
|
LEFT JOIN (SELECT apply_amount_info_id,emp_name,status,date_time,emp_id FROM dg_audit_process WHERE (apply_amount_info_id,date_time) IN |
|
|
|
|
(SELECT apply_amount_info_id,MAX(date_time) FROM dg_audit_process GROUP BY apply_amount_info_id)) AS p |
|
|
|
|
ON a.id = p.apply_amount_info_id |
|
|
|
|
LEFT JOIN crms_customer AS c |
|
|
|
|
ON a.company_id = c.id |
|
|
|
|
WHERE c.del_or_not = 0 |
|
|
|
|
<if test="pr.flowStatus == null"> |
|
|
|
|
AND ( |
|
|
|
|
a.presenter_id = #{pr.personId} |
|
|
|
|
OR |
|
|
|
|
p.emp_id = #{pr.personId} |
|
|
|
|
) |
|
|
|
|
</if> |
|
|
|
|
<if test="pr.flowStatus == 0"> |
|
|
|
|
AND a.presenter_id = #{pr.personId} |
|
|
|
|
</if> |
|
|
|
|
<if test="pr.flowStatus == 1"> |
|
|
|
|
AND p.emp_id = #{pr.personId} |
|
|
|
|
</if> |
|
|
|
|
<if test="pr.empOrName != null and pr.empOrName != ''"> |
|
|
|
|
AND c.name LIKE CONCAT('%',#{sr.empOrName},'%') |
|
|
|
|
</if> |
|
|
|
|
<if test="pr.startTime != null and pr.startTime != ''"> |
|
|
|
|
AND a.create_time >= #{pr.startTime} |
|
|
|
|
</if> |
|
|
|
|
<if test="pr.endTime != null and pr.endTime != ''"> |
|
|
|
|
AND a.create_time <= #{pr.endTime} |
|
|
|
|
</if> |
|
|
|
|
ORDER BY a.create_time DESC |
|
|
|
|
<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> |
|
|
|
|
|
|
|
|
|
</mapper> |