| | |
| | | <mapper namespace="com.example.erp.mapper.sd.OrderMapper"> |
| | | <select id="selectMaxOrderId"> |
| | | select |
| | | COUNT(a.order_id) |
| | | ifnull(SUBSTR(max(order_id) from 9),0) |
| | | from |
| | | `order` as a |
| | | where |
| | | date(a.create_time) = curdate() |
| | | order by id desc,order_id desc limit 1 |
| | | </select> |
| | | |
| | | |
| | |
| | | * |
| | | from |
| | | `order` as o |
| | | where o.create_time>=#{startDate} and o.create_time <= #{endDate} |
| | | where date(o.create_time)>=#{startDate} and date(o.create_time) <= #{endDate} |
| | | |
| | | <if test="orderType!= null and orderType != ''"> |
| | | and o.create_order = #{orderType} |
| | |
| | | </if> |
| | | |
| | | <if test="order.customerId != null and order.customerId != ''"> |
| | | and o.customer_id REGEXP #{customerId} |
| | | and o.customer_id REGEXP #{order.customerId} |
| | | </if> |
| | | <if test="order.customerName != null and order.customerName != ''"> |
| | | and o.customer_name REGEXP #{customerName} |
| | | and o.customer_name REGEXP #{order.customerName} |
| | | </if> |
| | | <if test="order.project != null and order.project != ''"> |
| | | and o.project REGEXP #{order.project} |
| | |
| | | </if> |
| | | |
| | | <if test="order.area != null and order.area != ''"> |
| | | and o.area REGEXP #{order.area} |
| | | and o.area REGEXP REGEXP_REPLACE(#{order.area}, '\\.0+$', '') |
| | | </if> |
| | | <if test="order.createTime != null and order.createTime != ''"> |
| | | and date(o.create_time) = #{order.createTime} |
| | |
| | | |
| | | <select id="getPageTotal"> |
| | | select |
| | | CEILING(count(o.id)/#{pageSize}) |
| | | CEILING(count(o.id)/#{pageSize}) as 'pageTotal', |
| | | count(o.id) as 'total' |
| | | from |
| | | `order` as o |
| | | where o.create_time>=#{startDate} and o.create_time <= #{endDate} |
| | | where date (o.create_time)>=#{startDate} and date(o.create_time) <= #{endDate} |
| | | <if test="orderType!= null and orderType != ''"> |
| | | and o.create_order = #{orderType} |
| | | </if> |
| | |
| | | </if> |
| | | |
| | | <if test="order.customerId != null and order.customerId != ''"> |
| | | and o.customer_id REGEXP #{customerId} |
| | | and o.customer_id REGEXP #{order.customerId} |
| | | </if> |
| | | <if test="order.customerName != null and order.customerName != ''"> |
| | | and o.customer_name REGEXP #{customerName} |
| | | and o.customer_name REGEXP #{order.customerName} |
| | | </if> |
| | | <if test="order.project != null and order.project != ''"> |
| | | and o.project REGEXP #{order.project} |
| | |
| | | <if test="order.deliveryAddress != null and order.deliveryAddress != ''"> |
| | | and o.delivery_address REGEXP #{order.deliveryAddress} |
| | | </if> |
| | | |
| | | order by o.id desc |
| | | limit #{offset},#{pageSize} |
| | | </select> |
| | | |
| | | <update id="reviewOrderById"> |
| | | update `order` set order_review = #{status} where order_id = #{id} |
| | | </update> |
| | | |
| | | <update id="reviewProcessById"> |
| | | update `order` set process_review = #{status} where order_id = #{id} |
| | | </update> |
| | | |
| | | <update id="updateMoney"> |
| | | update `order` set money = #{order.money} where order_id = #{order.orderId} |
| | | </update> |
| | | |
| | | </mapper> |