You've already forked FrameTour-BE
添加“order”相关CRUD代码
This commit is contained in:
@ -13,6 +13,36 @@
|
||||
values
|
||||
(#{id}, #{parentId}, #{target}, #{name}, #{type}, #{sort}, #{permissionUrl}, #{isRemove}, #{businessType}, #{icon})
|
||||
</insert>
|
||||
<update id="update">
|
||||
update menu
|
||||
<set>
|
||||
<if test="parentId!= null ">
|
||||
parent_id = #{parentId},
|
||||
</if>
|
||||
<if test="target!= null and target!= ''">
|
||||
target = #{target},
|
||||
</if>
|
||||
<if test="name!= null and name!= ''">
|
||||
`name` = #{name},
|
||||
</if>
|
||||
<if test="type!= null ">
|
||||
`type` = #{type},
|
||||
</if>
|
||||
<if test="sort!= null ">
|
||||
sort = #{sort},
|
||||
</if>
|
||||
<if test="permissionUrl!= null and permissionUrl!= ''">
|
||||
permission_url = #{permissionUrl},
|
||||
</if>
|
||||
<if test="businessType!= null ">
|
||||
business_type = #{businessType},
|
||||
</if>
|
||||
<if test="icon!= null and icon!= ''">
|
||||
icon = #{icon},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="delete">
|
||||
delete
|
||||
|
118
src/main/resources/mapper/pc/OrderMapper.xml
Normal file
118
src/main/resources/mapper/pc/OrderMapper.xml
Normal file
@ -0,0 +1,118 @@
|
||||
<?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.ycwl.basic.mapper.pc.OrderMapper">
|
||||
<insert id="add">
|
||||
insert into `order`(id, member_id, openid,price, pay_price, remark, broker_id, promo_code)
|
||||
VALUES (#{id}, #{memberId}, #{openid},#{price}, #{payPrice}, #{remark}, #{brokerId}, #{promoCode})
|
||||
</insert>
|
||||
<update id="update">
|
||||
update `order`
|
||||
<set>
|
||||
<if test="price!= null ">
|
||||
price = #{price},
|
||||
</if>
|
||||
<if test="payPrice!= null ">
|
||||
pay_price = #{payPrice},
|
||||
</if>
|
||||
<if test="remark!= null and remark!= ''">
|
||||
remark = #{remark},
|
||||
</if>
|
||||
<if test="refundReason!= null and refundReason!= ''">
|
||||
refund_reason = #{refundReason},
|
||||
</if>
|
||||
<if test="refundStatus!= null ">
|
||||
refund_status = #{refundStatus},
|
||||
</if>
|
||||
<if test="status!= null ">
|
||||
`status` = #{status},
|
||||
</if>
|
||||
<if test="refundAt!= null ">
|
||||
refund_at = #{refundAt},
|
||||
</if>
|
||||
<if test="payAt!= null ">
|
||||
pay_at = #{payAt},
|
||||
</if>
|
||||
<if test="cancelAt!= null ">
|
||||
cancel_at = #{cancelAt},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id}
|
||||
</update>
|
||||
<delete id="deleteById">
|
||||
delete from `order` where id = #{id}
|
||||
</delete>
|
||||
<select id="list" resultType="com.ycwl.basic.model.pc.order.resp.OrderRespVO">
|
||||
select o.id, member_id,m.nickname memberNickname,m.real_name memberRealName, o.openid, price, pay_price, remark, o.broker_id, o.promo_code,
|
||||
refund_reason, refund_status, `status`, refund_at, pay_at, cancel_at
|
||||
from `order` o
|
||||
left join member m on o.member_id = m.id
|
||||
<where>
|
||||
<if test="id!= null ">
|
||||
and o.id = #{id}
|
||||
</if>
|
||||
<if test="memberNickname!= null and memberNickname!=''">
|
||||
and m.nickname like concat('%',#{memberNickname},'%')
|
||||
</if>
|
||||
<if test="memberRealName!= null and memberRealName!=''">
|
||||
and m.real_name like concat('%',#{memberRealName},'%')
|
||||
</if>
|
||||
<if test="price!= null ">
|
||||
and price = #{price}
|
||||
</if>
|
||||
<if test="payPrice!= null ">
|
||||
and pay_price = #{payPrice}
|
||||
</if>
|
||||
<if test="remark!= null and remark!= ''">
|
||||
and remark like concat('%',#{remark},'%')
|
||||
</if>
|
||||
<if test="brokerId!= null ">
|
||||
and o.broker_id = #{brokerId}
|
||||
</if>
|
||||
<if test="promoCode!= null and promoCode!= ''">
|
||||
and o.promo_code like concat('%',#{promoCode},'%')
|
||||
</if>
|
||||
<if test="refundReason!= null and refundReason!= ''">
|
||||
and refund_reason like concat('%',#{refundReason},'%')
|
||||
</if>
|
||||
<if test="refundStatus!= null ">
|
||||
and refund_status = #{refundStatus}
|
||||
</if>
|
||||
<if test="status!= null ">
|
||||
and `status` = #{status}
|
||||
</if>
|
||||
<if test="startCreateTime!= null ">
|
||||
and o.create_at >= #{startCreateTime}
|
||||
</if>
|
||||
<if test="endCreateTime!= null ">
|
||||
and o.create_at <= #{endCreateTime}
|
||||
</if>
|
||||
<if test="startPayTime!= null ">
|
||||
and pay_at >= #{startPayTime}
|
||||
</if>
|
||||
<if test="endPayTime!= null ">
|
||||
and pay_at <= #{endPayTime}
|
||||
</if>
|
||||
<if test="startRefundTime!= null ">
|
||||
and refund_at >= #{startRefundTime}
|
||||
</if>
|
||||
<if test="endRefundTime!= null ">
|
||||
and refund_at <= #{endRefundTime}
|
||||
</if>
|
||||
<if test="startCancelTime!= null ">
|
||||
and cancel_at >= #{startCancelTime}
|
||||
</if>
|
||||
<if test="endCancelTime!= null ">
|
||||
and cancel_at <= #{endCancelTime}
|
||||
</if>
|
||||
</where>
|
||||
order by o.create_at desc
|
||||
</select>
|
||||
<select id="getById" resultType="com.ycwl.basic.model.pc.order.entity.OrderEntity">
|
||||
select o.id, o.member_id, o.openid, o.price, o.pay_price, o.remark, o.broker_id, o.promo_code, o.refund_reason,
|
||||
o.refund_status, o.status, o.create_at, o.update_at, o.pay_at, o.cancel_at, o.refund_at,
|
||||
m.nickname memberNickname, m.real_name memberRealName
|
||||
from `order` o
|
||||
left join member m on m.id = o.member_id
|
||||
where o.id = #{id}
|
||||
</select>
|
||||
</mapper>
|
Reference in New Issue
Block a user