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.
73 lines
3.8 KiB
73 lines
3.8 KiB
<?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.DgGuaranteeAssignUserMapper"> |
|
|
|
<!-- 通用查询映射结果 --> |
|
<resultMap id="BaseResultMap" type="com.daqing.framework.domain.guarantee.DgGuaranteeAssignUser"> |
|
<id column="id" property="id" /> |
|
<result column="company_id" property="companyId" /> |
|
<result column="emp_id" property="empId" /> |
|
<result column="type" property="type" /> |
|
<result column="status" property="status" /> |
|
<result column="operating_status" property="operatingStatus" /> |
|
<result column="amount" property="amount" /> |
|
<result column="term" property="term" /> |
|
<result column="remark" property="remark" /> |
|
<result column="other_remark" property="otherRemark" /> |
|
<result column="apply_content" property="applyContent" /> |
|
<result column="create_time" property="createTime" /> |
|
<result column="update_time" property="updateTime" /> |
|
</resultMap> |
|
|
|
<select id="pageByCondition" resultType="com.daqing.financial.guarantee.model.response.GuaranteeListResponse"> |
|
select au.id,au.role_id,au.company_id,au.business_id,ai.business_code,ai.business_type,ai.apply_amount,ai.apply_time,au.create_time, |
|
au.status,au.operating_status,cc.name,cc.phone,ps.business_status |
|
from dg_guarantee_assign_user au |
|
left join dg_apply_amount_info ai on au.business_id = ai.id |
|
left join crms_company_customer ccl on ai.company_id = ccl.id |
|
left join crms_customer cc on cc.id = ccl.customer_id |
|
left JOIN dg_business_process_status ps ON ps.business_id = au.business_id |
|
<where> |
|
au.role_id in |
|
<foreach collection="roleIdlist" open="(" separator="," close=")" item="id"> |
|
#{id} |
|
</foreach> |
|
<if test="customerNumberOrName != null and customerNumberOrName != ''"> |
|
AND (ai.business_code LIKE CONCAT('%',#{customerNumberOrName},'%') OR cc.name LIKE CONCAT('%',#{customerNumberOrName},'%')) |
|
</if> |
|
<if test="status != null"> |
|
AND au.status = #{status} |
|
</if> |
|
<if test="userId != null and userId != ''"> |
|
AND (au.emp_id =#{userId} or au.emp_id is null) |
|
</if> |
|
</where> |
|
ORDER BY au.create_time DESC |
|
</select> |
|
|
|
<select id="selectListByIds" resultType="com.daqing.financial.guarantee.model.response.GuaranteeListResponse"> |
|
select au.id,au.company_id,au.business_id,ai.business_code,ai.business_type,ai.apply_amount,ai.apply_time,au.create_time, |
|
au.status,au.operating_status,cc.name,cc.phone,ps.business_status |
|
from dg_guarantee_assign_user au |
|
left join dg_apply_amount_info ai on au.business_id = ai.id |
|
left join crms_company_customer ccl on ai.company_id = ccl.id |
|
left join crms_customer cc on cc.id = ccl.customer_id |
|
left JOIN dg_business_process_status ps ON ps.business_id = au.business_id |
|
where au.id in |
|
<foreach collection="list" close=")" open="(" item="id" separator=","> |
|
#{id} |
|
</foreach> |
|
</select> |
|
|
|
<!-- 改变所有业务id相同的审核状态,用于拒绝或者驳回 --> |
|
<update id="updateAuditStatusByBusinessId"> |
|
UPDATE dg_guarantee_assign_user SET status = #{auditStatus} WHERE business_id = #{businessId} |
|
</update> |
|
|
|
<!-- 根据业务id和角色id改变该数据的操作状态 --> |
|
<update id="updateOperationStatusById"> |
|
UPDATE dg_guarantee_assign_user SET operating_status = #{operationStatus} |
|
WHERE business_id = #{businessId} AND (role_id = 59 OR role_id = 60) |
|
</update> |
|
|
|
</mapper>
|
|
|