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.

61 lines
3.2 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.DgGuaranteeLetterAssignUserMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.daqing.framework.domain.guarantee.DgGuaranteeLetterAssignUser">
<id column="id" property="id" />
<result column="business_id" property="businessId" />
<result column="company_id" property="companyId" />
4 years ago
<result column="user_id" property="userId" />
4 years ago
<result column="status" property="status" />
<result column="create_time" property="createTime" />
<result column="update_time" property="updateTime" />
</resultMap>
4 years ago
<resultMap id="GuaranteeLetterListResponseMap" type="com.daqing.financial.guarantee.model.response.GuaranteeLetterListResponse">
4 years ago
<id column="id" property="id" />
<result column="business_code" property="businessCode" />
<result column="bank" property="bank" />
4 years ago
<result column="passing_time" property="passingTime" />
4 years ago
<result column="file" property="file" />
<result column="name" property="name" />
<result column="phone" property="phone" />
<result column="status" property="status" />
<result column="create_time" property="createTime" />
4 years ago
<result column="loan_tern" property="loanTern" />
<result column="loan_money" property="loanMoney" />
4 years ago
<result column="business_type" property="businessType" />
<result column="audit_opinion" property="auditOpinion" />
<result column="operating_status" property="operatingStatus" />
<result column="business_status" property="businessStatus" />
4 years ago
</resultMap>
<select id="pageByCondition" resultMap="GuaranteeLetterListResponseMap">
4 years ago
select lau.id,aai.business_code,cc.name,cc.phone,aai.business_type,lcc.loan_money,lcc.loan_tern,aai.create_time,
lau.status,aai.bank,lcc.passing_time,lcc.file,lau.audit_opinion,lau.operating_status,bps.business_status
4 years ago
from dg_guarantee_letter_assign_user lau
left join dg_apply_amount_info aai on lau.business_id = aai.id
left join crms_company_customer ccc on lau.company_id = ccc.id
left join crms_customer cc on ccc.customer_id = cc.id
left join dg_loan_committee_consider lcc on lau.business_id = lcc.business_id
left join dg_business_process_status bps on lau.business_id = bps.business_id
4 years ago
<where>
4 years ago
lau.role_id in
<foreach collection="roleIdList" open="(" separator="," close=")" item="id">
#{id}
</foreach>
4 years ago
<if test="userId != null and userId != ''">
4 years ago
AND (lau.user_id = #{userId} or lau.user_id is null)
4 years ago
</if>
<if test="customerNumberOrName != null and customerNumberOrName != ''">
AND aai.business_code LIKE CONCAT('%',#{customerNumberOrName},'%') OR cc.name LIKE CONCAT('%',#{customerNumberOrName},'%')
</if>
<if test="status != null and status != ''">
AND lau.status = #{status}
4 years ago
</if>
</where>
</select>
4 years ago
</mapper>