1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- <?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="cn.newfeifan.mall.module.distri.dal.mysql.shopsettlement.ShopSettlementMapper">
- <!--
- 一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
- 无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
- 代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
- 文档可见:https://www.zhongxing.cn/MyBatis/x-plugins/
- -->
- <resultMap id="BaseResultMap" type="cn.newfeifan.mall.module.distri.service.dailybill.dto.OrderDTO">
- <id column="id" property="id" />
- <collection ofType="list" property="items" select="getOrderItem" column="id">
- </collection>
- </resultMap>
- <update id="setOrderItemById">
- update trade_order_item
- set settlement_time = now()
- where id in
- <foreach item="ids" collection="ids" open="(" separator="," close=")">
- #{ids}
- </foreach>
- </update>
- <select id="getOrderByMerchantIdWithsShopId"
- resultMap="BaseResultMap">
- select id,no from trade_order
- where pay_status = 1
- and deleted = 0
- and status = 30
- and shop_id = #{shopId}
- and merchant_id = #{merchantId}
- and date(receiving_time) <![CDATA[ <= ]]> DATE_SUB(now(),INTERVAL 7 DAY)
- </select>
- <select id="getOrderItem" resultType="cn.newfeifan.mall.module.distri.service.dailybill.dto.OrderItemDTO">
- select id,order_id,count,price,delivery_price,pay_price,high_precision_price,promotion_fee,cost_price,pay_integral,pay_rmb from trade_order_item
- where deleted = 0
- and settlement_time is null
- and after_sale_status = 0
- and order_id = #{id}
- </select>
- <select id="getShopName" resultType="java.lang.String">
- select name from sale_shop where id = #{shopId}
- </select>
- </mapper>
|