| | |
| | | <result column="quantity_available" property="finishedGoodsInventory.quantityAvailable"/> |
| | | </resultMap> |
| | | |
| | | <resultMap id="selectDeliveryOrder" type="com.example.erp.entity.sd.Delivery"> |
| | | |
| | | <result column="id" property="id"/> |
| | | <result column="delivery_state" property="deliveryState"/> |
| | | <result column="stock_state" property="stockState"/> |
| | | <result column="payment_terms" property="paymentTerms"/> |
| | | <result column="delivery_id" property="deliveryId"/> |
| | | <result column="order_id" property="orderId"/> |
| | | <result column="project" property="project"/> |
| | | <result column="customer_id" property="customerId"/> |
| | | <result column="customer_name" property="customerName"/> |
| | | <result column="delivery_date" property="deliveryDate"/> |
| | | <result column="pay_method" property="payMethod"/> |
| | | <result column="pay_date" property="payDate"/> |
| | | <result column="salesman_id" property="salesmanId"/> |
| | | <result column="salesman" property="salesman"/> |
| | | <result column="creator_id" property="creatorId"/> |
| | | <result column="creator" property="creator"/> |
| | | <result column="contacts" property="contacts"/> |
| | | <result column="contact_number" property="contactNumber"/> |
| | | <result column="delivery_address" property="deliveryAddress"/> |
| | | <result column="area" property="area"/> |
| | | |
| | | <result column="quantity" property="quantity"/> |
| | | <result column="money" property="money"/> |
| | | <result column="other_money" property="otherMoney"/> |
| | | <result column="remarks" property="remarks"/> |
| | | <result column="create_time" property="createTime"/> |
| | | <result column="batch" property="order.batch"/> |
| | | </resultMap> |
| | | |
| | | |
| | | <delete id="deleteDelivery"> |
| | | delete from sd.delivery where delivery_id=#{deliveryId} |
| | |
| | | limit 0,1 |
| | | </select> |
| | | |
| | | <select id="getSelectShippingOrder"> |
| | | <select id="getSelectShippingOrder" resultMap="selectDeliveryOrder"> |
| | | select * from sd.delivery d left join sd.delivery_detail dd on d.delivery_id=dd.delivery_id |
| | | left join sd.order o on o.order_id=d.order_id |
| | | <where> |
| | | date(d.create_time)>=#{startDate} and date(d.create_time) <= #{endDate} |
| | | <if test="delivery.deliveryId != null and delivery.deliveryId != ''"> |
| | |
| | | <if test="delivery.stockState != null "> |
| | | and d.stock_state = #{delivery.stockState} |
| | | </if> |
| | | <if test="delivery.order != null and delivery.order.batch != null and delivery.order.batch != ''"> |
| | | and o.batch regexp #{delivery.order.batch} |
| | | </if> |
| | | |
| | | </where> |
| | | group by d.delivery_id |
| | |
| | | |
| | | <select id="getSelectShippingOrderPageTotal"> |
| | | select |
| | | CEILING(count(id)/#{pageSize}) as 'pageTotal', |
| | | count(id) as 'total' |
| | | CEILING(count(d.id)/#{pageSize}) as 'pageTotal', |
| | | count(d.id) as 'total' |
| | | from sd.delivery d |
| | | left join sd.order o on o.order_id=d.order_id |
| | | <where> |
| | | date(d.create_time)>=#{startDate} and date(d.create_time) <= #{endDate} |
| | | <if test="delivery.deliveryId != null and delivery.deliveryId != ''"> |
| | |
| | | <if test="delivery.stockState != null "> |
| | | and d.stock_state = #{delivery.stockState} |
| | | </if> |
| | | <if test="delivery.order != null and delivery.order.batch != null and delivery.order.batch != ''"> |
| | | and o.batch regexp #{delivery.order.batch} |
| | | </if> |
| | | </where> |
| | | limit #{offset},#{pageSize}; |
| | | </select> |