<?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.ruoyi.other.mapper.ShopMapper">
|
|
<select id="selectNearbyShopList" resultType="com.ruoyi.other.vo.NearbyShopVO">
|
SELECT id,
|
home_picture,
|
name,
|
address,
|
longitude,
|
latitude
|
FROM t_shop
|
where del_flag = 0 and status = 1
|
</select>
|
<select id="selectShopDetail" resultType="com.ruoyi.other.vo.ShopDetailVO">
|
SELECT
|
ts.id,
|
ts.details_picture,
|
ts.certification,
|
ts.`name`,
|
ts.address,
|
ts.business_date,
|
ts.start_time,
|
ts.end_time,
|
ts.longitude,
|
ts.latitude,
|
ts.status,
|
(select ROUND(AVG(score), 1) from t_shop_score where shop_id = ts.id) as score
|
FROM
|
t_shop ts
|
WHERE ts.del_flag = 0 AND ts.id = #{shopId}
|
</select>
|
<select id="selectShopList" resultType="com.ruoyi.other.api.domain.Shop">
|
SELECT
|
ts.*
|
FROM
|
t_shop ts
|
<where>
|
ts.del_flag = 0
|
<if test="shop.name != null and shop.name != ''">
|
and ts.name like concat('%',#{shop.name},'%')
|
</if>
|
<if test="shop.shopManager != null and shop.shopManager != ''">
|
and ts.shop_manager like concat('%',#{shop.shopManager},'%')
|
</if>
|
<if test="shop.phone != null and shop.phone != ''">
|
and ts.phone like concat('%',#{shop.phone},'%')
|
</if>
|
<if test="shop.status != null and shop.status != ''">
|
and ts.status = #{shop.status}
|
</if>
|
</where>
|
order by ts.create_time desc
|
</select>
|
<select id="getShopStatistics" resultType="com.ruoyi.other.vo.ShopStatistics">
|
SELECT
|
SUM(ts.shop_all_point) totalPoint,
|
SUM(ts.share_point) commissionPoint,
|
SUM(ts.server_point) servicePoint,
|
SUM(ts.lower_level_share_point) bindCommissionPoint,
|
SUM(ts.giveaway_all_money) totalCommissionMoney,
|
SUM(ts.giveaway_money) commissionMoney,
|
SUM(ts.lower_level_giveaway_money) bindCommissionMoney,
|
SUM(ts.server_giveaway_money) serviceCommissionMoney,
|
SUM(ts.order_number) totalOrder,
|
SUM(ts.server_order_number) serviceOrder,
|
SUM(ts.custom_order_number) goodsOrder,
|
SUM(ts.can_withdraw_money) canWithdrawMoney,
|
SUM(ts.withdraw_money) alreadyWithdrawMoney
|
FROM
|
t_shop ts
|
<if test="null != shopId">
|
where ts.id = #{shopId}
|
</if>
|
</select>
|
</mapper>
|