101 lines
3.8 KiB
XML
101 lines
3.8 KiB
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._3e.dao.OrderInfoDao">
|
||
|
|
<select id= "getNextSeq" resultType="int">
|
||
|
|
SELECT NEXTVAL('seq_orderinfoid')
|
||
|
|
</select>
|
||
|
|
|
||
|
|
<insert id= "doSave" parameterType="com._3e.entity.Orderinfo" >
|
||
|
|
INSERT INTO orderinfo(orderinfoid,uid,ispayed,isdeleted,payway,description,amount,gains,fees,created,paytime,areaid,paynumber,channel,orderno)
|
||
|
|
VALUES (
|
||
|
|
<if test="orderinfoid == 0">
|
||
|
|
(SELECT NEXTVAL('seq_orderinfoid')),
|
||
|
|
</if>
|
||
|
|
<if test="orderinfoid != 0">
|
||
|
|
#{orderinfoid},
|
||
|
|
</if>
|
||
|
|
#{uid},#{ispayed},#{isdeleted},#{payway},#{description},#{amount},#{gains},#{fees},#{created},#{paytime},#{areaid},#{paynumber},#{channel},#{orderno})
|
||
|
|
</insert>
|
||
|
|
|
||
|
|
<insert id= "doSaveOrderowngoods" parameterType="com._3e.entity.Orderowngoods">
|
||
|
|
INSERT INTO orderowngoods(orderowngoodsid,orderinfoid,goodsid,years,starttime,endtime,price,amount,areaid)
|
||
|
|
VALUES (
|
||
|
|
<if test="orderowngoodsid == 0">
|
||
|
|
(SELECT NEXTVAL('seq_orderowngoodsid')),
|
||
|
|
</if>
|
||
|
|
<if test="orderowngoodsid != 0">
|
||
|
|
#{orderowngoodsid},
|
||
|
|
</if>
|
||
|
|
#{orderinfoid},#{goodsid},#{years},#{starttime},#{endtime},#{price},#{amount},#{areaid})
|
||
|
|
</insert>
|
||
|
|
|
||
|
|
<select id= "getOrderinfoByOrderno" parameterType="string" resultType="com._3e.entity.Orderinfo" >
|
||
|
|
SELECT * FROM Orderinfo
|
||
|
|
WHERE orderno = #{orderno}
|
||
|
|
</select>
|
||
|
|
|
||
|
|
<update id= "doUpdate" parameterType="com._3e.entity.Orderinfo">
|
||
|
|
Update orderinfo
|
||
|
|
<set>
|
||
|
|
<if test="uid != null">uid = #{uid},</if>
|
||
|
|
<if test="ispayed != null">ispayed = #{ispayed},</if>
|
||
|
|
<if test="isdeleted != null">isdeleted = #{isdeleted},</if>
|
||
|
|
<if test="payway != null">payway = #{payway},</if>
|
||
|
|
<if test="description != null">description = #{description},</if>
|
||
|
|
<if test="amount != null">amount = #{amount},</if>
|
||
|
|
<if test="gains != null">gains = #{gains},</if>
|
||
|
|
<if test="fees != null">fees = #{fees},</if>
|
||
|
|
<if test="created != null">created = #{created},</if>
|
||
|
|
<if test="paytime != null">paytime = #{paytime},</if>
|
||
|
|
<if test="areaid != null">areaid = #{areaid},</if>
|
||
|
|
<if test="paynumber != null">paynumber = #{paynumber},</if>
|
||
|
|
<if test="channel != null">channel = #{channel},</if>
|
||
|
|
<if test="orderno != null">orderno = #{orderno}</if>
|
||
|
|
</set>
|
||
|
|
WHERE orderinfoid = #{orderinfoid}
|
||
|
|
</update>
|
||
|
|
|
||
|
|
<update id= "doUpdateOrderowngoods" parameterType="com._3e.entity.Orderowngoods">
|
||
|
|
Update orderowngoods
|
||
|
|
<set>
|
||
|
|
<if test="orderinfoid != null">orderinfoid = #{orderinfoid},</if>
|
||
|
|
<if test="goodsid != null">goodsid = #{goodsid},</if>
|
||
|
|
<if test="years != null">years = #{years},</if>
|
||
|
|
<if test="starttime != null">starttime = #{starttime},</if>
|
||
|
|
<if test="endtime != null">endtime = #{endtime},</if>
|
||
|
|
<if test="price != null">price = #{price},</if>
|
||
|
|
<if test="amount != null">amount = #{amount},</if>
|
||
|
|
<if test="areaid != null">areaid = #{areaid}</if>
|
||
|
|
</set>
|
||
|
|
WHERE orderowngoodsid = #{orderowngoodsid}
|
||
|
|
</update>
|
||
|
|
|
||
|
|
<select id= "findOrderList" parameterType="long" resultType="com._3e.http.pay.dto.OrderinfoDto" >
|
||
|
|
SELECT * FROM Orderinfo
|
||
|
|
WHERE uid = #{uid} and ispayed = 1 and amount > 0
|
||
|
|
ORDER BY created desc
|
||
|
|
</select>
|
||
|
|
|
||
|
|
<select id= "findOrderListV2" parameterType="long" resultType="com._3e.http.pay.dto.OrderinfoDto" >
|
||
|
|
SELECT * FROM Orderinfo
|
||
|
|
WHERE uid = #{uid} and ispayed != 0 and amount > 0
|
||
|
|
ORDER BY created desc
|
||
|
|
</select>
|
||
|
|
|
||
|
|
<select id= "findOrderowgoodsList" parameterType="long" resultType="com._3e.entity.Orderowngoods" >
|
||
|
|
SELECT * FROM Orderowngoods
|
||
|
|
WHERE orderinfoid = #{orderinfoid}
|
||
|
|
</select>
|
||
|
|
|
||
|
|
<select id= "findOrderowgoodsLists" parameterType="list" resultType="com._3e.entity.Orderowngoods" >
|
||
|
|
SELECT * FROM Orderowngoods
|
||
|
|
WHERE orderinfoid in
|
||
|
|
<foreach item="orderinfoid" index="index" collection="list"
|
||
|
|
open="(" separator="," close=")">
|
||
|
|
#{orderinfoid}
|
||
|
|
</foreach>
|
||
|
|
</select>
|
||
|
|
</mapper>
|