feat:fw->zp
This commit is contained in:
parent
bd2c04d272
commit
a7e38bdb3c
@ -19,7 +19,7 @@ import java.util.Date;
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Accessors(chain = true)
|
||||
@TableName("fw_system_store")
|
||||
@TableName("zp_system_store")
|
||||
@ApiModel(value="SystemStoreNearVo对象", description="门店自提")
|
||||
public class SystemStoreNearVo implements Serializable {
|
||||
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
|
||||
<select id="getListGroup" resultType="com.yzt.common.response.ShippingTemplatesFreeResponse" parameterType="integer">
|
||||
SELECT group_concat(`title`) AS title, `number`, price, uniqid
|
||||
FROM fw_shipping_templates_free
|
||||
FROM zp_shipping_templates_free
|
||||
where temp_id = #{tempId, jdbcType=INTEGER}
|
||||
GROUP BY `uniqid` ORDER BY id ASC
|
||||
</select>
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
|
||||
<select id="getListGroup" resultType="com.yzt.common.response.ShippingTemplatesRegionResponse" parameterType="integer">
|
||||
SELECT group_concat(`title`) AS title, `first`, first_price, `renewal`, renewal_price, uniqid
|
||||
FROM fw_shipping_templates_region
|
||||
FROM zp_shipping_templates_region
|
||||
where temp_id = #{tempId, jdbcType=INTEGER}
|
||||
GROUP BY `uniqid`
|
||||
ORDER BY id ASC
|
||||
|
||||
@ -5,10 +5,10 @@
|
||||
SELECT u.uid, u.nickname, u.now_money, u.brokerage_price AS brokerage,u.create_time,u.spread_uid,
|
||||
IF(( Sum(b.price) ) IS NULL, 0.00, Sum(b.price)) AS total_brokerage,
|
||||
-- IF(( Sum(e.extract_price) ) IS NULL, 0.00, Sum(e.extract_price)) AS total_extract
|
||||
(SELECT if(Sum( e.extract_price ) IS NULL, 0.00, Sum( e.extract_price ) ) from fw_user_extract e where e.uid = u.uid and e.`status` = 1 ) AS total_extract
|
||||
FROM fw_user AS u
|
||||
LEFT JOIN fw_user_brokerage_record AS b ON u.uid = b.uid AND b.link_type = 'order' AND b.`type` = 1 AND b.`status` = 3
|
||||
-- LEFT JOIN fw_user_extract AS e ON u.`uid` = e.uid AND e.STATUS = 1
|
||||
(SELECT if(Sum( e.extract_price ) IS NULL, 0.00, Sum( e.extract_price ) ) from zp_user_extract e where e.uid = u.uid and e.`status` = 1 ) AS total_extract
|
||||
FROM zp_user AS u
|
||||
LEFT JOIN zp_user_brokerage_record AS b ON u.uid = b.uid AND b.link_type = 'order' AND b.`type` = 1 AND b.`status` = 3
|
||||
-- LEFT JOIN zp_user_extract AS e ON u.`uid` = e.uid AND e.STATUS = 1
|
||||
where 1 = 1
|
||||
<if test="keywords != '' and keywords != null ">
|
||||
and ( u.uid like #{keywords} or u.nickname like #{keywords, jdbcType=VARCHAR})
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
<mapper namespace="com.yzt.service.mapper.UserRechargeMapper">
|
||||
<!-- 根据类型获取该类型充值金额-->
|
||||
<select id="getSumByType" resultType="java.math.BigDecimal" parameterType="string">
|
||||
select sum(price) as price from fw_user_recharge
|
||||
select sum(price) as price from zp_user_recharge
|
||||
where paid = 1
|
||||
<if test="type != null and type != '' ">
|
||||
and recharge_type = #{type, jdbcType=VARCHAR}
|
||||
@ -11,7 +11,7 @@
|
||||
</select>
|
||||
<!-- 获取退款总额-->
|
||||
<select id="getSumByRefund" resultType="java.math.BigDecimal">
|
||||
select sum(refund_price) as price from fw_user_recharge
|
||||
select sum(refund_price) as price from zp_user_recharge
|
||||
where refund_price > 0 and paid = 1
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
|
||||
<select id="getListByPreOrderNo" resultType="com.yzt.common.model.coupon.StoreCouponUser" parameterType="Map">
|
||||
SELECT *
|
||||
FROM fw_store_coupon_user
|
||||
FROM zp_store_coupon_user
|
||||
where
|
||||
`status` = 0
|
||||
AND min_price <= #{maxPrice}
|
||||
|
||||
@ -6,10 +6,10 @@
|
||||
SELECT
|
||||
p.id, p.uid, p.bargain_id, p.bargain_price_min,
|
||||
p.bargain_price, p.price, p.status, p.add_time, p.is_del
|
||||
FROM fw_store_bargain_user p
|
||||
FROM zp_store_bargain_user p
|
||||
INNER JOIN (
|
||||
SELECT uid, MAX(id) AS max_id
|
||||
FROM fw_store_bargain_user
|
||||
FROM zp_store_bargain_user
|
||||
WHERE status = 3 AND is_del = FALSE
|
||||
GROUP BY uid
|
||||
) AS tmp ON p.uid = tmp.uid AND p.id = tmp.max_id
|
||||
|
||||
@ -3,14 +3,14 @@
|
||||
<mapper namespace="com.yzt.service.mapper.StoreOrderInfoMapper">
|
||||
|
||||
<select id="getSalesNumByDateAndProductId" resultType="java.lang.Integer">
|
||||
select IFNULL(sum(pay_num), 0) as pay_num from fw_store_order_info
|
||||
where order_id in (SELECT id FROM `fw_store_order` where paid = 1 and date_format(create_time, '%Y-%m-%d') = #{date})
|
||||
select IFNULL(sum(pay_num), 0) as pay_num from zp_store_order_info
|
||||
where order_id in (SELECT id FROM `zp_store_order` where paid = 1 and date_format(create_time, '%Y-%m-%d') = #{date})
|
||||
and product_id = #{proId}
|
||||
</select>
|
||||
|
||||
<select id="getSalesByDateAndProductId" resultType="java.math.BigDecimal">
|
||||
select IFNULL(sum(vip_price), 0) as price from fw_store_order_info
|
||||
where order_id in (SELECT id FROM `fw_store_order` where paid = 1 and date_format(create_time, '%Y-%m-%d') = #{date})
|
||||
select IFNULL(sum(vip_price), 0) as price from zp_store_order_info
|
||||
where order_id in (SELECT id FROM `zp_store_order` where paid = 1 and date_format(create_time, '%Y-%m-%d') = #{date})
|
||||
and product_id = #{proId}
|
||||
</select>
|
||||
|
||||
|
||||
@ -3,8 +3,8 @@
|
||||
<mapper namespace="com.yzt.service.mapper.StoreOrderStatusMapper">
|
||||
|
||||
<select id="getRefundOrderAmountByDate" resultType="java.math.BigDecimal">
|
||||
SELECT IFNULL(sum(o.refund_price),0) FROM `fw_store_order_status` os
|
||||
left join fw_store_order o on os.oid = o.id
|
||||
SELECT IFNULL(sum(o.refund_price),0) FROM `zp_store_order_status` os
|
||||
left join zp_store_order o on os.oid = o.id
|
||||
where date_format(os.create_time, '%Y-%m-%d') = #{date}
|
||||
and os.change_type = 'refund_price'
|
||||
</select>
|
||||
|
||||
@ -7,10 +7,10 @@
|
||||
p.id, p.uid, p.order_id, p.order_id_key, p.total_num, p.total_price,
|
||||
p.cid, p.pid, p.people, p.price, p.add_time, p.stop_time, p.k_id,
|
||||
p.is_tpl, p.is_refund, p.status, p.nickname, p.avatar, p.is_virtual
|
||||
FROM fw_store_pink p
|
||||
FROM zp_store_pink p
|
||||
INNER JOIN (
|
||||
SELECT uid, MAX(id) AS max_id
|
||||
FROM fw_store_pink
|
||||
FROM zp_store_pink
|
||||
WHERE is_refund = 'false' AND status IN (1, 2)
|
||||
GROUP BY uid
|
||||
) AS tmp ON p.uid = tmp.uid AND p.id = tmp.max_id
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.yzt.service.mapper.StoreProductAttrMapper">
|
||||
<update id="updateByProductId" parameterType="com.yzt.common.model.product.StoreProductAttr">
|
||||
update fw_store_product_attr
|
||||
update zp_store_product_attr
|
||||
<set>
|
||||
attr_name = #{ attrName },
|
||||
attr_values = #{ attrValues },
|
||||
|
||||
@ -4,8 +4,8 @@
|
||||
<select id="getUserList" resultType="com.yzt.common.response.UserRelationResponse" parameterType="java.lang.Integer">
|
||||
-- SELECT r.id,r.product_id as productId,r.create_time as createTime,p.store_name as storeName,p.image,p.price
|
||||
SELECT r.id,r.product_id,r.create_time,p.store_name,p.image,p.price
|
||||
FROM fw_store_product_relation r
|
||||
INNER JOIN fw_store_product p ON r.product_id = p.id And p.is_show = 1
|
||||
FROM zp_store_product_relation r
|
||||
INNER JOIN zp_store_product p ON r.product_id = p.id And p.is_show = 1
|
||||
where r.`type` = 'collect'
|
||||
<if test="uid != '' and type != null">
|
||||
and r.uid = #{uid}
|
||||
|
||||
@ -4,20 +4,20 @@
|
||||
|
||||
<select id="findPermissionByUserId" resultType="com.yzt.common.model.system.SystemMenu" parameterType="Integer" >
|
||||
SELECT m.*
|
||||
FROM fw_system_menu m
|
||||
right join fw_system_role_menu rm on rm.menu_id = m.id
|
||||
right join fw_system_role r on rm.rid = r.id
|
||||
right join fw_system_admin a on FIND_IN_SET(r.id, a.roles)
|
||||
FROM zp_system_menu m
|
||||
right join zp_system_role_menu rm on rm.menu_id = m.id
|
||||
right join zp_system_role r on rm.rid = r.id
|
||||
right join zp_system_admin a on FIND_IN_SET(r.id, a.roles)
|
||||
where m.is_delte = 0 and r.`status` = 1 and a.id = #{userId}
|
||||
GROUP BY m.id
|
||||
</select>
|
||||
|
||||
<select id="getMenusByUserId" resultType="com.yzt.common.model.system.SystemMenu" parameterType="Integer" >
|
||||
SELECT m.*
|
||||
FROM fw_system_menu m
|
||||
right join fw_system_role_menu rm on rm.menu_id = m.id
|
||||
right join fw_system_role r on rm.rid = r.id
|
||||
right join fw_system_admin a on FIND_IN_SET(r.id, a.roles)
|
||||
FROM zp_system_menu m
|
||||
right join zp_system_role_menu rm on rm.menu_id = m.id
|
||||
right join zp_system_role r on rm.rid = r.id
|
||||
right join zp_system_admin a on FIND_IN_SET(r.id, a.roles)
|
||||
where m.is_delte = 0 and r.`status` = 1 and m.menu_type != 'A' and m.is_show = 1 and a.id = #{userId}
|
||||
GROUP BY m.id
|
||||
</select>
|
||||
|
||||
@ -4,10 +4,10 @@
|
||||
|
||||
<select id="findPermissionByUserId" resultType="com.yzt.common.model.system.SystemPermissions" parameterType="Integer" >
|
||||
SELECT p.id,p.pid,p.name,p.path
|
||||
FROM fw_system_permissions p
|
||||
right join fw_system_role_permissions rp on rp.pid = p.id
|
||||
right join fw_system_role r on rp.rid = r.id
|
||||
right join fw_system_admin a on FIND_IN_SET(r.id, a.roles)
|
||||
FROM zp_system_permissions p
|
||||
right join zp_system_role_permissions rp on rp.pid = p.id
|
||||
right join zp_system_role r on rp.rid = r.id
|
||||
right join zp_system_admin a on FIND_IN_SET(r.id, a.roles)
|
||||
where p.is_delte = 0 and r.`status` = 1 and a.id = #{userId}
|
||||
GROUP BY p.id;
|
||||
</select>
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
|
||||
<select id="getNearList" resultType="com.yzt.common.vo.SystemStoreNearVo" parameterType="com.yzt.common.request.StoreNearRequest">
|
||||
SELECT *, (round(6367000 * 2 * asin(sqrt(pow(sin(((latitude * pi()) / 180 - (${latitude} * pi()) / 180) / 2), 2) + cos((${latitude} * pi()) / 180) * cos((latitude * pi()) / 180) * pow(sin(((longitude * pi()) / 180 - (${longitude} * pi()) / 180) / 2), 2))))) AS distance
|
||||
FROM fw_system_store WHERE is_show = 1 and is_del = 0
|
||||
FROM zp_system_store WHERE is_show = 1 and is_del = 0
|
||||
ORDER BY distance asc
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@ -3,8 +3,8 @@
|
||||
<mapper namespace="com.yzt.service.mapper.UserBillMapper">
|
||||
|
||||
<select id="getListAdminAndIntegeal" resultType="com.yzt.common.response.UserBillResponse" parameterType="map">
|
||||
SELECT ub.id,ub.link_id AS linkId,ub.pm,ub.title,ub.category,ub.type,ub.number,ub.balance,ub.mark,ub.status,ub.create_time AS createTime,ub.update_time AS updateTime,u.nickname,ub.uid FROM fw_user_bill ub
|
||||
LEFT JOIN fw_user u ON ub.uid = u.uid
|
||||
SELECT ub.id,ub.link_id AS linkId,ub.pm,ub.title,ub.category,ub.type,ub.number,ub.balance,ub.mark,ub.status,ub.create_time AS createTime,ub.update_time AS updateTime,u.nickname,ub.uid FROM zp_user_bill ub
|
||||
LEFT JOIN zp_user u ON ub.uid = u.uid
|
||||
where 1 = 1
|
||||
<if test="keywords != '' and keywords != null ">
|
||||
and ( ub.id like #{keywords} or ub.uid like #{keywords} or ub.link_id like #{keywords, jdbcType=VARCHAR} or ub.title like #{keywords, jdbcType=VARCHAR} or u.nickname like #{keywords, jdbcType=VARCHAR})
|
||||
@ -29,8 +29,8 @@
|
||||
</select>
|
||||
|
||||
<select id="fundMonitoring" resultType="com.yzt.common.response.UserBillResponse" parameterType="map">
|
||||
SELECT ub.id,ub.link_id AS linkId,ub.link_type AS linkType,ub.pm,ub.title,ub.category,ub.type,ub.number,ub.balance,ub.mark,ub.status,ub.create_time AS createTime,ub.update_time AS updateTime,u.nickname,u.phone,u.level,u.tenant_id AS tenantId,ub.uid FROM fw_user_bill ub
|
||||
LEFT JOIN fw_user u ON ub.uid = u.uid
|
||||
SELECT ub.id,ub.link_id AS linkId,ub.link_type AS linkType,ub.pm,ub.title,ub.category,ub.type,ub.number,ub.balance,ub.mark,ub.status,ub.create_time AS createTime,ub.update_time AS updateTime,u.nickname,u.phone,u.level,u.tenant_id AS tenantId,ub.uid FROM zp_user_bill ub
|
||||
LEFT JOIN zp_user u ON ub.uid = u.uid
|
||||
where ub.category = 'now_money'
|
||||
<if test="keywords != '' and keywords != null ">
|
||||
and u.nickname like #{keywords, jdbcType=VARCHAR}
|
||||
|
||||
@ -21,7 +21,7 @@
|
||||
MAX(update_time) as update_time,
|
||||
MAX(brokerage_level) as brokerage_level,
|
||||
MAX(attr_type) as attr_type
|
||||
FROM fw_user_brokerage_record
|
||||
FROM zp_user_brokerage_record
|
||||
WHERE uid = #{uid} and link_type != 'order'
|
||||
GROUP BY uid, link_id, link_type
|
||||
ORDER BY MAX(update_time) DESC
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user