后端代码提交

This commit is contained in:
zzp
2025-06-24 16:23:52 +08:00
parent 3202f42aac
commit f677859b57
1284 changed files with 8023 additions and 17640 deletions

View File

@@ -2,7 +2,10 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zbkj.service.dao.ShippingTemplatesFreeDao">
<select id="getListGroup" resultType="com.zbkj.common.request.ShippingTemplatesFreeRequest" parameterType="integer">
SELECT group_concat(`city_id`) AS city_id, title, `number`, price, uniqid FROM eb_shipping_templates_free where temp_id = #{tempId, jdbcType=INTEGER} GROUP BY `uniqid` ORDER BY id ASC
<select id="getListGroup" resultType="com.zbkj.common.response.ShippingTemplatesFreeResponse" parameterType="integer">
SELECT group_concat(`title`) AS title, `number`, price, uniqid
FROM eb_shipping_templates_free
where temp_id = #{tempId, jdbcType=INTEGER}
GROUP BY `uniqid` ORDER BY id ASC
</select>
</mapper>

View File

@@ -2,7 +2,11 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zbkj.service.dao.ShippingTemplatesRegionDao">
<select id="getListGroup" resultType="com.zbkj.common.request.ShippingTemplatesRegionRequest" parameterType="integer">
SELECT group_concat(`city_id`) AS city_id, title, `first`, first_price, `renewal`, renewal_price, uniqid FROM eb_shipping_templates_region where temp_id = #{tempId, jdbcType=INTEGER} GROUP BY `uniqid` ORDER BY id ASC
<select id="getListGroup" resultType="com.zbkj.common.response.ShippingTemplatesRegionResponse" parameterType="integer">
SELECT group_concat(`title`) AS title, `first`, first_price, `renewal`, renewal_price, uniqid
FROM eb_shipping_templates_region
where temp_id = #{tempId, jdbcType=INTEGER}
GROUP BY `uniqid`
ORDER BY id ASC
</select>
</mapper>

View File

@@ -20,6 +20,6 @@
and u.brokerage_price >= #{min, jdbcType=DECIMAL}
</if>
GROUP BY u.uid
order by total_brokerage #{sort}
order by total_brokerage ${sort}
</select>
</mapper>

View File

@@ -1,20 +0,0 @@
<?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.zbkj.service.dao.MySqlGenDao">
<select id="getList" resultType="map">
select table_name tableName, engine, table_comment tableComment, create_time createTime from information_schema.tables
where table_schema = (select database())
<if test="tables != null and tables.trim() != ''">
and table_name like concat('%', #{tables}, '%')
</if>
order by create_time desc
</select>
<select id="getTable" resultType="map">
select table_name tableName, engine, table_comment tableComment, create_time createTime from information_schema.tables
where table_schema = (select database()) and table_name = #{tables}
</select>
<select id="getColumns" resultType="map">
select column_name columnName, data_type dataType, column_comment columnComment, column_key columnKey, extra from information_schema.columns
where table_name = #{tables} and table_schema = (select database()) order by ordinal_position
</select>
</mapper>

View File

@@ -2,4 +2,28 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zbkj.service.dao.StoreCouponUserDao">
<select id="getListByPreOrderNo" resultType="com.zbkj.common.model.coupon.StoreCouponUser" parameterType="Map">
SELECT *
FROM eb_store_coupon_user
where
`status` = 0
AND min_price &lt;= #{maxPrice}
AND start_time &lt; #{date} AND end_time &gt; #{date}
AND uid = #{uid}
AND (use_type = 1
or (use_type = 2 and
<foreach collection="productIds" item="proId" open="(" close=")" index="index" separator="or">
find_in_set(#{proId}, primary_key)
</foreach>
)
or (use_type = 3 and
<foreach collection="categoryIdList" item="cateId" open="(" close=")" index="index" separator="or">
find_in_set(#{cateId}, primary_key)
</foreach>
)
)
order by id desc
</select>
</mapper>

View File

@@ -2,4 +2,18 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zbkj.service.dao.StoreBargainUserDao">
<select id="selectHeaderList" resultType="com.zbkj.common.model.bargain.StoreBargainUser">
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 eb_store_bargain_user p
INNER JOIN (
SELECT uid, MAX(id) AS max_id
FROM eb_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
ORDER BY p.id DESC
LIMIT 10
</select>
</mapper>

View File

@@ -11,6 +11,61 @@
<select id="getRefundTotal" resultType="java.lang.Integer">
select count(id) from eb_store_order where ${where} and refund_status = 2
</select>
<select id="findFrontList" resultType="com.zbkj.common.model.order.StoreOrder" parameterType="Map">
select * from eb_store_order
where
uid = #{uid}
<if test="status != null ">
<choose>
<when test="status == 0">
and `status` = 0
and `paid` = 0
and `refund_status` = 0
and `type` = 0
</when>
<when test="status == 1">
and `status` = 0
and `paid` = 1
and `refund_status` = 0
</when>
<when test="status == 2">
and `status` = 1
and `paid` = 1
and `refund_status` = 0
</when>
<when test="status == 3">
and `status` = 2
and `paid` = 1
and `refund_status` = 0
</when>
<when test="status == 4">
and `status` = 3
and `paid` = 1
and `refund_status` = 0
</when>
<when test="status == -1">
and `paid` = 1
and `refund_status` in(1,3)
</when>
<when test="status == -2">
and `paid` = 1
and `refund_status` = 2
</when>
<when test="status == -3">
and `paid` = 1
and `refund_status` in(1,2,3)
</when>
</choose>
</if>
and is_del = 0
and is_system_del = 0
<if test="keywords != null and keywords !='' ">
and (order_id like CONCAT('%',#{keywords},'%')
or
order_id in (select order_no from eb_store_order_info where product_name like CONCAT('%',#{keywords},'%')))
</if>
order by id desc
</select>
<select id="getOrderVerificationDetail" parameterType="com.zbkj.common.request.PageParamRequest"
resultType="com.zbkj.common.response.StoreStaffDetail">
select sum(o.`pay_price`) as price, count(o.`id`) as count, DATE_FORMAT(o.`create_time`, '%Y-%m-%d') as time

View File

@@ -2,4 +2,19 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zbkj.service.dao.StorePinkDao">
<select id="selectSizePink" resultType="com.zbkj.common.model.combination.StorePink">
SELECT
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 eb_store_pink p
INNER JOIN (
SELECT uid, MAX(id) AS max_id
FROM eb_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
ORDER BY p.id DESC
LIMIT #{size};
</select>
</mapper>

View File

@@ -1,5 +0,0 @@
<?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.zbkj.service.dao.StoreProductCateDao">
</mapper>

View File

@@ -3,7 +3,7 @@
<mapper namespace="com.zbkj.service.dao.SystemStoreDao">
<select id="getNearList" resultType="com.zbkj.common.vo.SystemStoreNearVo" parameterType="com.zbkj.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
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 eb_system_store WHERE is_show = 1 and is_del = 0
ORDER BY distance asc
</select>

View File

@@ -3,15 +3,21 @@
<mapper namespace="com.zbkj.service.dao.UserDao">
<select id="getSpreadPeopleList" resultType="com.zbkj.common.response.UserSpreadPeopleItemResponse" parameterType="map">
SELECT u.uid,u.nickname, u.avatar, DATE_FORMAT(u.spread_time, '%Y-%m-%d %H:%i:%s') AS `time`, u.spread_count AS childCount FROM eb_user AS u
where 1 = 1
<if test="userIdList != null and userIdList !='' ">
and u.uid in (${userIdList})
</if>
SELECT u.uid,u.nickname, u.avatar, DATE_FORMAT(u.spread_time, '%Y-%m-%d %H:%i:%s') AS `time`, u.spread_count AS childCount,
(SELECT count( * ) AS num FROM eb_store_order AS o RIGHT JOIN eb_user_brokerage_record AS br ON br.link_id = o.order_id AND br.STATUS = 3
WHERE o.uid = u.uid AND br.uid = u.spread_uid AND o.STATUS > 1) AS orderCount,
(SELECT IFNULL( sum( o.pay_price ), 0 ) AS price FROM eb_store_order AS o RIGHT JOIN eb_user_brokerage_record AS br ON br.link_id = o.order_id AND br.STATUS = 3
WHERE o.uid = u.uid AND br.uid = u.spread_uid AND o.STATUS > 1) AS numberCount
FROM eb_user AS u
where
u.uid in
<foreach item="uid" collection="userIdList" open="(" separator="," close=")">
#{uid}
</foreach>
<if test="keywords != '' and keywords != null ">
and ( u.real_name like #{keywords, jdbcType=VARCHAR} or u.nickname like #{keywords, jdbcType=VARCHAR})
and ( u.real_name like CONCAT('%',#{keywords},'%') or u.nickname like CONCAT('%',#{keywords},'%'))
</if>
ORDER BY #{sortKey} #{sortValue}
ORDER BY ${sortKey} ${sortValue}
</select>
<select id="findAdminList" resultType="com.zbkj.common.model.user.User" parameterType="Map">
@@ -26,14 +32,20 @@
<if test="isPromoter != null and isPromoter !='' or isPromoter == 0 ">
and u.is_promoter = #{isPromoter}
</if>
<if test="groupId != null and groupId !='' ">
and u.group_id in (#{groupId})
<if test="groupIdList != null and groupIdList.size() > 0 ">
and u.group_id in
<foreach item="group_id" collection="groupIdList" open="(" separator="," close=")">
#{group_id}
</foreach>
</if>
<if test="tagIdSql != null and tagIdSql !='' ">
and ${tagIdSql}
</if>
<if test="level != null and level !='' ">
and u.level in (#{level})
<if test="levelList != null and levelList.size() > 0 ">
and u.level in
<foreach item="level" collection="levelList" open="(" separator="," close=")">
#{level}
</foreach>
</if>
<if test="sex != null and sex !='' or sex == 0">
and u.sex = #{sex}
@@ -42,14 +54,14 @@
and u.country = #{country}
</if>
<if test="addres != null and addres !='' ">
and u.addres like concat('%',#{addres}, '%')
and u.addres like CONCAT('%',#{addres},'%')
</if>
<if test="payCount != null and payCount !='' or payCount == 0 ">
<if test="payCount &lt;= 0">
and u.pay_count = 0
</if>
<if test="payCount > 0">
and u.pay_count >= #{payCount}
and u.pay_count >= ${payCount}
</if>
</if>
<if test="status != null and status !='' or status == 0 ">
@@ -57,23 +69,23 @@
</if>
<if test="startTime != null and startTime != '' and accessType != null and accessType != ''">
<choose>
<when test="accessType = 1">
<when test="accessType == 1">
and create_time between #{startTime} and #{endTime}
and create_time = last_login_time
</when>
<when test="accessType = 2">
<when test="accessType == 2">
and last_login_time between #{startTime} and #{endTime}
</when>
<when test="accessType = 3">
<when test="accessType == 3">
and last_login_time not between #{startTime} and #{endTime}
</when>
<otherwise>
and create_time between #{startTime} and #{endTime}
and last_login_time between #{startTime} and #{endTime}
</otherwise>
</choose>
</if>
<if test="keywords != '' and keywords != null ">
and ( u.phone like #{keywords, jdbcType=VARCHAR} or u.nickname like "%"#{keywords, jdbcType=VARCHAR}"%" or u.mark like #{keywords, jdbcType=VARCHAR})
and ( u.phone like CONCAT('%',#{keywords},'%') or u.nickname like CONCAT('%',#{keywords},'%') or u.mark like CONCAT('%',#{keywords},'%'))
</if>
ORDER BY u.uid desc
</select>