init
This commit is contained in:
20
ruoyi-dk/src/main/resources/mapper/BorrowMapper.xml
Normal file
20
ruoyi-dk/src/main/resources/mapper/BorrowMapper.xml
Normal file
@@ -0,0 +1,20 @@
|
||||
<?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.ruoyi.dk.mapper.BorrowMapper">
|
||||
<select id="pageAdmin" resultType="com.ruoyi.dk.dto.admin.resp.BorrowResp">
|
||||
select t1.*,t2.phone_number as customer_login_name,
|
||||
ifnull(t3.withdraw_flag,1) as withdraw_flag
|
||||
from dk_borrow t1
|
||||
left join dk_customer t2 on t1.customer_id = t2.id
|
||||
left join dk_borrow_status t3 on t1.borrow_status_id = t3.id
|
||||
<where>
|
||||
<if test="bo.tradeNo != null and bo.tradeNo != ''">
|
||||
and t1.trade_no = #{bo.tradeNo}
|
||||
</if>
|
||||
<if test="bo.realName != null and bo.realName != ''">
|
||||
and (t1.real_name like concat('%',#{bo.realName},'%') or t2.phone_number like concat('%',#{bo.realName},'%'))
|
||||
</if>
|
||||
</where>
|
||||
order by t1.create_time desc
|
||||
</select>
|
||||
</mapper>
|
||||
51
ruoyi-dk/src/main/resources/mapper/CustomerMapper.xml
Normal file
51
ruoyi-dk/src/main/resources/mapper/CustomerMapper.xml
Normal file
@@ -0,0 +1,51 @@
|
||||
<?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.ruoyi.dk.mapper.CustomerMapper">
|
||||
<update id="incsAmount">
|
||||
update dk_customer
|
||||
set account = account + #{totalLoanMoney},
|
||||
borrow_account = #{totalLoanMoney},
|
||||
repayment_account = repayment_account + #{totalRepayment}
|
||||
where id = #{customerId}
|
||||
</update>
|
||||
<update id="withdraw">
|
||||
update dk_customer
|
||||
set account = account - #{withdrawAmount}
|
||||
where id = #{customerId}
|
||||
</update>
|
||||
<select id="pageAdmin" resultType="com.ruoyi.dk.dto.admin.resp.CustomerAdminResp">
|
||||
select *,t2.allow_signature
|
||||
from dk_customer t1
|
||||
left join dk_customer_info t2 on t1.id = t2.customer_id
|
||||
<where>
|
||||
<if test="bo.phoneNumber != null and bo.phoneNumber != ''">
|
||||
and t1.phone_number like concat('%',#{bo.phoneNumber},'%')
|
||||
</if>
|
||||
<if test="bo.nickName != null and bo.nickName != ''">
|
||||
and (t1.nick_name like concat('%',#{bo.nickName},'%') or t2.real_name like concat('%',#{bo.nickName},'%'))
|
||||
</if>
|
||||
</where>
|
||||
order by t1.update_time desc
|
||||
</select>
|
||||
<select id="exportAdmin" resultType="com.ruoyi.dk.dto.admin.resp.CustomerExportVo">
|
||||
select phone_number, nick_name, real_name_auth, loans_flag, withdraw_flag,
|
||||
account, borrow_account, repayment_account, withdraw_account,
|
||||
status, last_login_ip, last_login_time, update_time,
|
||||
customer_id, real_name, card_num, card_front_picture,
|
||||
card_back_picture, company_name, company_title, company_phone,
|
||||
company_year, company_address, company_address_info,
|
||||
customer_address, customer_address_info, kinsfolk_name,
|
||||
kinsfolk_phone, kinsfolk_ref, bank_type, back_card_num
|
||||
from dk_customer t1
|
||||
left join dk_customer_info t2 on t1.id = t2.customer_id
|
||||
<where>
|
||||
<if test="bo.phoneNumber != null and bo.phoneNumber != ''">
|
||||
and t1.phone_number like concat('%',#{bo.phoneNumber},'%')
|
||||
</if>
|
||||
<if test="bo.nickName != null and bo.nickName != ''">
|
||||
and (t1.nick_name like concat('%',#{bo.nickName},'%') or t2.real_name like concat('%',#{bo.nickName},'%'))
|
||||
</if>
|
||||
</where>
|
||||
order by t1.update_time desc
|
||||
</select>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user