| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- <?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.cyksj.mapper.mirrorshop.UserMirrorShopMapper">
- <select id="selectSoldMaxGoods" resultType="java.lang.String">
- select title
- from goods_don
- where id = (select od.goods_id
- from (select id from user_mirror_shop where user_id = #{userId} limit 1) s
- inner join user_mirror_shop_order_relate omr on omr.mp_id = s.id
- inner join order_don od
- on od.id = omr.order_id and od.status not in ('close', 'noPayment', 'refund')
- group by od.goods_id
- order by max(od.money) desc limit 1)
- </select>
- <select id="selectUserMIrrorShopDetail" resultType="java.util.Map">
- select count(distinct ys.user_id) as numOfYhShop,
- count(distinct us.user_id) as numOfRegisterYhShopUser
- from (select user_id from `user_mirror_shop` ys
- where 1 = 1
- <if test="startDate != null">
- and created_time >= #{startDate}
- </if>
- <if test="endDate != null">
- and created_time < #{endDate}
- </if>) ys left join user_mirror_shop_user_distribute_shared us on us.shop_user_id = ys.user_id
- </select>
- <select id="selectUserMirrorShopTakeMoney" resultType="java.math.BigDecimal">
- select ifnull(sum(money),0) from `user_mirror_shop_distribute_waiting_send_points` where send_status in
- ('waiting','success')
- <if test="startDate != null">
- and created_time >= #{startDate}
- </if>
- <if test="endDate != null">
- and created_time < #{endDate}
- </if>
- </select>
- <select id="selectUserMirrorShopApplyMoney" resultType="java.util.Map">
- select ifnull(sum(if(verify_status = 'success',money,0)),0)s,
- ifnull(sum(if(verify_status = 'verifying',money,0)),0)vf
- from user_mirror_shop_distribute_money_apply where verify_status in ('verifying','success')
- <if test="startDate != null">
- and created_time >= #{startDate}
- </if>
- <if test="endDate != null">
- and created_time < #{endDate}
- </if>
- </select>
- </mapper>
|