|
|
@ -2,64 +2,45 @@ |
|
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|
|
|
<!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"> |
|
|
|
<mapper namespace="com.daqing.financial.guarantee.mapper.DgEfficiencyMapper"> |
|
|
|
|
|
|
|
|
|
|
|
<resultMap id="BaseResultMap" type="com.daqing.framework.domain.guarantee.DgApplyAmountInfo"> |
|
|
|
<select id="queryList" resultType="com.daqing.framework.domain.guarantee.po.DgTeamEfficiencyPO"> |
|
|
|
<id column="id" property="id" /> |
|
|
|
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 |
|
|
|
<result column="company_id" property="companyId" /> |
|
|
|
FROM dg_audit_process AS p |
|
|
|
<result column="presenter_id" property="presenterId" /> |
|
|
|
LEFT JOIN dg_apply_amount_info AS a |
|
|
|
<result column="apply_amount" property="applyAmount" /> |
|
|
|
ON p.business_id = a.id |
|
|
|
<result column="apply_time" property="applyTime" /> |
|
|
|
LEFT JOIN dg_business_process_status AS s |
|
|
|
<result column="bank" property="bank" /> |
|
|
|
ON p.business_id = s.business_id |
|
|
|
<result column="amount_wide" property="amountWide" /> |
|
|
|
WHERE 1 = 1 |
|
|
|
<result column="en_guarantee_measures" property="enGuaranteeMeasures" /> |
|
|
|
<if test="et.flowStatus != null"> |
|
|
|
<result column="business_type" property="businessType" /> |
|
|
|
AND s.business_status = #{et.flowStatus} |
|
|
|
<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> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<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> |
|
|
|
<if test="pr.flowStatus == 0"> |
|
|
|
<if test="et.startTime != null and et.startTime != ''"> |
|
|
|
AND a.presenter_id = #{pr.personId} |
|
|
|
AND a.create_time >= #{et.startTime} |
|
|
|
</if> |
|
|
|
</if> |
|
|
|
<if test="pr.flowStatus == 1"> |
|
|
|
<if test="et.endTime != null and et.endTime != ''"> |
|
|
|
AND p.emp_id = #{pr.personId} |
|
|
|
AND a.create_time <= #{et.endTime} |
|
|
|
</if> |
|
|
|
</if> |
|
|
|
<if test="pr.empOrName != null and pr.empOrName != ''"> |
|
|
|
ORDER BY p.create_time ASC |
|
|
|
AND c.name LIKE CONCAT('%',#{sr.empOrName},'%') |
|
|
|
</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> |
|
|
|
<if test="pr.startTime != null and pr.startTime != ''"> |
|
|
|
<if test="et.startTime != null and et.startTime != ''"> |
|
|
|
AND a.create_time >= #{pr.startTime} |
|
|
|
AND a.create_time >= #{et.startTime} |
|
|
|
</if> |
|
|
|
</if> |
|
|
|
<if test="pr.endTime != null and pr.endTime != ''"> |
|
|
|
<if test="et.endTime != null and et.endTime != ''"> |
|
|
|
AND a.create_time <= #{pr.endTime} |
|
|
|
AND a.create_time <= #{et.endTime} |
|
|
|
</if> |
|
|
|
</if> |
|
|
|
ORDER BY a.create_time DESC |
|
|
|
GROUP BY business_id |
|
|
|
|
|
|
|
ORDER BY p.create_time ASC |
|
|
|
</select> |
|
|
|
</select> |
|
|
|
|
|
|
|
|
|
|
|
</mapper> |
|
|
|
</mapper> |