BootYK/Boot-module/module-Buy/src/main/resources/mapper/BuyMapper.xml

28 lines
980 B
XML

<?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.bw.mapper.BuyMapper">
<insert id="loans">
insert into yk_buy (buy_time,buy_price,number,interest,handling_charge,
buy_user_id,total_price,everyissue_price)
values (#{buyTime},#{buyPrice},#{number},#{interest},#{handlingCharge},#{buyUserId},#{totalPrice},#{everyissuePrice})
</insert>
<update id="updloanUserId">
update yk_buy
set loan_user_id = #{userId},
status = 1
where id = #{id}
</update>
<select id="orderList" resultType="com.bw.common.domain.Order">
SELECT
b.*,
ba.bank_name
FROM
yk_buy b
LEFT JOIN yk_user us on us.id = b.loan_user_id
LEFT JOIN yk_bank ba on ba.id = us.bank_id
</select>
</mapper>