验证码
个人中心-菜单页 首页接口 预约到店(店铺列表) 通用商品列表 登录 退出登录 商品详情(缺少评价部分) 订单页 列表 详情
This commit is contained in:
184
src/main/resources/mapper/TbGroupOrderInfoMapper.xml
Normal file
184
src/main/resources/mapper/TbGroupOrderInfoMapper.xml
Normal file
@@ -0,0 +1,184 @@
|
||||
<?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.chaozhanggui.system.cashierservice.dao.TbGroupOrderInfoMapper">
|
||||
|
||||
<resultMap type="com.chaozhanggui.system.cashierservice.entity.TbGroupOrderInfo" id="TbGroupOrderInfoMap">
|
||||
<result property="id" column="id" jdbcType="INTEGER"/>
|
||||
<result property="orderNo" column="order_no" jdbcType="VARCHAR"/>
|
||||
<result property="shopId" column="shop_id" jdbcType="INTEGER"/>
|
||||
<result property="userId" column="user_id" jdbcType="INTEGER"/>
|
||||
<result property="proId" column="pro_id" jdbcType="INTEGER"/>
|
||||
<result property="proName" column="pro_name" jdbcType="VARCHAR"/>
|
||||
<result property="proImg" column="pro_img" jdbcType="VARCHAR"/>
|
||||
<result property="couponNo" column="coupon_no" jdbcType="VARCHAR"/>
|
||||
<result property="couponUrl" column="coupon_url" jdbcType="VARCHAR"/>
|
||||
<result property="expDate" column="exp_date" jdbcType="TIMESTAMP"/>
|
||||
<result property="orderType" column="order_type" jdbcType="VARCHAR"/>
|
||||
<result property="orderAmount" column="order_amount" jdbcType="NUMERIC"/>
|
||||
<result property="saveAmount" column="save_amount" jdbcType="NUMERIC"/>
|
||||
<result property="payAmount" column="pay_amount" jdbcType="NUMERIC"/>
|
||||
<result property="number" column="number" jdbcType="INTEGER"/>
|
||||
<result property="status" column="status" jdbcType="VARCHAR"/>
|
||||
<result property="remark" column="remark" jdbcType="VARCHAR"/>
|
||||
<result property="phone" column="phone" jdbcType="VARCHAR"/>
|
||||
<result property="payTime" column="pay_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="refundAble" column="refund_able" jdbcType="INTEGER"/>
|
||||
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="payOrderNo" column="pay_order_no" jdbcType="VARCHAR"/>
|
||||
<result property="tradeDay" column="trade_day" jdbcType="TIMESTAMP"/>
|
||||
<result property="source" column="source" jdbcType="INTEGER"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id
|
||||
, order_no, shop_id, user_id, pro_id, pro_name,pro_img, coupon_no, coupon_url, exp_date, order_type, order_amount, save_amount, pay_amount, number, status, remark, phone, pay_time, refund_able, create_time, update_time, pay_order_no, trade_day, source </sql>
|
||||
<sql id="List_Column">
|
||||
id
|
||||
, order_no, pro_name,pro_img,coupon_url,order_amount, pay_amount, number, status </sql>
|
||||
|
||||
<!--查询单个-->
|
||||
<select id="queryById" resultMap="TbGroupOrderInfoMap">
|
||||
select
|
||||
<include refid="Base_Column_List"/>
|
||||
|
||||
from tb_group_order_info
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<!--查询指定行数据-->
|
||||
<select id="queryAll" resultType="com.chaozhanggui.system.cashierservice.entity.vo.GroupOrderListVo">
|
||||
select
|
||||
<include refid="List_Column"/>
|
||||
|
||||
from tb_group_order_info
|
||||
<where>
|
||||
<if test="userId != null">
|
||||
and user_id = #{userId}
|
||||
</if>
|
||||
<if test="proName != null and proName != ''">
|
||||
and pro_name = #{proName}
|
||||
</if>
|
||||
<if test="status != null and status != ''">
|
||||
and status = #{status}
|
||||
</if>
|
||||
</where>
|
||||
order by create_time desc
|
||||
</select>
|
||||
|
||||
|
||||
<!--新增所有列-->
|
||||
<insert id="insert" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into tb_group_order_info(order_no, shop_id, user_id, pro_id, pro_name, pro_img, coupon_no, coupon_url,
|
||||
exp_date, order_type, order_amount, save_amount, pay_amount, number, status,
|
||||
remark, phone, pay_time, refund_able, create_time, update_time, pay_order_no,
|
||||
trade_day, source)
|
||||
values (#{orderNo}, #{shopId}, #{userId}, #{proId}, #{proName}, #{proImg}, #{couponNo}, #{couponUrl},
|
||||
#{expDate}, #{orderType}, #{orderAmount}, #{saveAmount}, #{payAmount}, #{number}, #{status}, #{remark},
|
||||
#{phone}, #{payTime}, #{refundAble}, #{createTime}, #{updateTime}, #{payOrderNo}, #{tradeDay},
|
||||
#{source})
|
||||
</insert>
|
||||
|
||||
<insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into tb_group_order_info(order_no, shop_id, user_id, pro_id, pro_name, pro_img, coupon_no, coupon_url,
|
||||
exp_date, order_type, order_amount, save_amount, pay_amount, number, status, remark, phone, pay_time,
|
||||
refund_able, create_time, update_time, pay_order_no, trade_day, source)
|
||||
values
|
||||
<foreach collection="entities" item="entity" separator=",">
|
||||
(#{entity.orderNo}, #{entity.shopId}, #{entity.userId}, #{entity.proId}, #{entity.proName},#{entity.proImg}
|
||||
#{entity.couponNo}, #{entity.couponUrl}, #{entity.expDate}, #{entity.orderType},
|
||||
#{entity.orderAmount}, #{entity.saveAmount}, #{entity.payAmount}, #{entity.number}, #{entity.status},
|
||||
#{entity.remark}, #{entity.phone}, #{entity.payTime}, #{entity.refundAble}, #{entity.createTime},
|
||||
#{entity.updateTime}, #{entity.payOrderNo}, #{entity.tradeDay}, #{entity.source})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<!--通过主键修改数据-->
|
||||
<update id="update">
|
||||
update tb_group_order_info
|
||||
<set>
|
||||
<if test="orderNo != null and orderNo != ''">
|
||||
order_no = #{orderNo},
|
||||
</if>
|
||||
<if test="shopId != null">
|
||||
shop_id = #{shopId},
|
||||
</if>
|
||||
<if test="userId != null">
|
||||
user_id = #{userId},
|
||||
</if>
|
||||
<if test="proId != null">
|
||||
pro_id = #{proId},
|
||||
</if>
|
||||
<if test="proName != null and proName != ''">
|
||||
pro_name = #{proName},
|
||||
</if>
|
||||
<if test="proImg != null and proImg != ''">
|
||||
pro_img = #{proImg},
|
||||
</if>
|
||||
<if test="couponNo != null and couponNo != ''">
|
||||
coupon_no = #{couponNo},
|
||||
</if>
|
||||
<if test="couponUrl != null and couponUrl != ''">
|
||||
coupon_url = #{couponUrl},
|
||||
</if>
|
||||
<if test="expDate != null">
|
||||
exp_date = #{expDate},
|
||||
</if>
|
||||
<if test="orderType != null and orderType != ''">
|
||||
order_type = #{orderType},
|
||||
</if>
|
||||
<if test="orderAmount != null">
|
||||
order_amount = #{orderAmount},
|
||||
</if>
|
||||
<if test="saveAmount != null">
|
||||
save_amount = #{saveAmount},
|
||||
</if>
|
||||
<if test="payAmount != null">
|
||||
pay_amount = #{payAmount},
|
||||
</if>
|
||||
<if test="number != null">
|
||||
number = #{number},
|
||||
</if>
|
||||
<if test="status != null and status != ''">
|
||||
status = #{status},
|
||||
</if>
|
||||
<if test="remark != null and remark != ''">
|
||||
remark = #{remark},
|
||||
</if>
|
||||
<if test="phone != null and phone != ''">
|
||||
phone = #{phone},
|
||||
</if>
|
||||
<if test="payTime != null">
|
||||
pay_time = #{payTime},
|
||||
</if>
|
||||
<if test="refundAble != null">
|
||||
refund_able = #{refundAble},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time = #{createTime},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time = #{updateTime},
|
||||
</if>
|
||||
<if test="payOrderNo != null and payOrderNo != ''">
|
||||
pay_order_no = #{payOrderNo},
|
||||
</if>
|
||||
<if test="tradeDay != null">
|
||||
trade_day = #{tradeDay},
|
||||
</if>
|
||||
<if test="source != null">
|
||||
source = #{source},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<!--通过主键删除-->
|
||||
<delete id="deleteById">
|
||||
delete
|
||||
from tb_group_order_info
|
||||
where id = #{id}
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
|
||||
@@ -48,49 +48,6 @@
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="queryAllByPage" resultType="com.chaozhanggui.system.cashierservice.entity.vo.CouAndShopVo">
|
||||
SELECT
|
||||
cou.id as id,
|
||||
cou.title as title,
|
||||
cou.shop_id as shopId,
|
||||
cou.amount as amount,
|
||||
cou.number as number,
|
||||
cou.ratio as ratio,
|
||||
cou.relation_ids as relationIds,
|
||||
info.shop_name as shopName,
|
||||
info.logo
|
||||
FROM
|
||||
tb_merchant_coupon as cou
|
||||
LEFT JOIN tb_shop_info as info ON cou.shop_id = info.id
|
||||
<where>
|
||||
cou.class_type = 'product'
|
||||
AND cou.`status` = 1
|
||||
AND cou.type = 2
|
||||
AND info.cities =#{cities}
|
||||
<if test="type != null and type != ''">
|
||||
AND category_id like concat('%',#{type,jdbcType=VARCHAR},'%')
|
||||
</if>
|
||||
<if test="rightTopLng != null and rightTopLng != '' and leftBottomLng != null and leftBottomLng != ''">
|
||||
AND info.lng BETWEEN #{leftBottomLng} AND #{rightTopLng}
|
||||
AND info.lat BETWEEN #{leftBottomLat} AND #{rightTopLat}
|
||||
</if>
|
||||
</where>
|
||||
|
||||
<choose>
|
||||
<when test="orderBy == '1'">
|
||||
ORDER BY (ABS(info.lat - #{lat}) + ABS(info.lng - #{lng})) ASC
|
||||
</when>
|
||||
<when test="orderBy == '2'">
|
||||
ORDER BY cou.number ASC
|
||||
</when>
|
||||
<when test="orderBy == '3'">
|
||||
ORDER BY cou.amount ASC
|
||||
</when>
|
||||
<otherwise>
|
||||
ORDER BY cou.id desc
|
||||
</otherwise>
|
||||
</choose>
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
|
||||
@@ -62,6 +62,7 @@
|
||||
<result column="enable_label" jdbcType="TINYINT" property="enableLabel" />
|
||||
<result column="tax_config_id" jdbcType="VARCHAR" property="taxConfigId" />
|
||||
<result column="spec_table_headers" jdbcType="VARCHAR" property="specTableHeaders" />
|
||||
<result column="group_category_id" jdbcType="VARCHAR" property="groupCategoryId" />
|
||||
</resultMap>
|
||||
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.chaozhanggui.system.cashierservice.entity.TbProductWithBLOBs">
|
||||
<result column="images" jdbcType="LONGVARCHAR" property="images" />
|
||||
@@ -80,7 +81,7 @@
|
||||
created_at, updated_at, base_sales_number, real_sales_number, sales_number, thumb_count,
|
||||
store_count, furnish_meal, furnish_express, furnish_draw, furnish_vir, is_combo,
|
||||
is_show_cash, is_show_mall, is_need_examine, show_on_mall_status, show_on_mall_time,
|
||||
show_on_mall_error_msg, enable_label, tax_config_id, spec_table_headers
|
||||
show_on_mall_error_msg, enable_label, tax_config_id, spec_table_headers,group_category_id
|
||||
</sql>
|
||||
<sql id="Blob_Column_List">
|
||||
images, video, notice, group_snap, spec_info, select_spec
|
||||
@@ -933,4 +934,48 @@
|
||||
#{item}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selGroups" resultType="com.chaozhanggui.system.cashierservice.entity.vo.ShopGroupInfoVo">
|
||||
SELECT
|
||||
info.id AS shopId,
|
||||
info.shop_name AS shopName,
|
||||
info.logo AS shopImg,
|
||||
info.tag AS shopTag,
|
||||
info.lat AS lat,
|
||||
info.lng AS lng,
|
||||
pro.id AS proId,
|
||||
pro.`name` AS proName,
|
||||
pro.cover_img AS proImg,
|
||||
pro.real_sales_number AS number
|
||||
FROM
|
||||
tb_product pro
|
||||
LEFT JOIN tb_shop_info AS info ON info.id = pro.shop_id
|
||||
<where>
|
||||
info.`status`='1'
|
||||
AND pro.is_combo = '1'
|
||||
AND info.cities = #{cities}
|
||||
<if test="type != null and type != ''">
|
||||
AND group_category_id LIKE concat('%',#{type,jdbcType=VARCHAR},'%')
|
||||
</if>
|
||||
<if test="rightTopLng != null and rightTopLng != '' and leftBottomLng != null and leftBottomLng != ''">
|
||||
AND info.lng BETWEEN #{leftBottomLng} AND #{rightTopLng}
|
||||
AND info.lat BETWEEN #{leftBottomLat} AND #{rightTopLat}
|
||||
</if>
|
||||
</where>
|
||||
<choose>
|
||||
<when test="orderBy == '1'">
|
||||
ORDER BY (ABS(info.lat - #{lat}) + ABS(info.lng - #{lng})) ASC
|
||||
</when>
|
||||
<when test="orderBy == '2'">
|
||||
ORDER BYpro.real_sales_number desc
|
||||
</when>
|
||||
<when test="orderBy == '3'">
|
||||
ORDER BY pro.low_price ASC
|
||||
</when>
|
||||
<otherwise>
|
||||
ORDER BY pro.id DESC
|
||||
</otherwise>
|
||||
</choose>
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -391,15 +391,17 @@
|
||||
</select>
|
||||
<select id="selectSale" resultType="com.chaozhanggui.system.cashierservice.entity.vo.HomeVO">
|
||||
SELECT
|
||||
pro.id as id,
|
||||
pro.`name` as productName,
|
||||
pro.cover_img as image,
|
||||
sku.origin_price as originPrice,
|
||||
sku.sale_price as salePrice,
|
||||
MAX(sku.real_sales_number) AS realSalesNumber
|
||||
pro.id AS id,
|
||||
pro.`name` AS productName,
|
||||
pro.cover_img AS image,
|
||||
sku.origin_price AS originPrice,
|
||||
sku.sale_price AS salePrice,
|
||||
MAX( sku.real_sales_number ) AS realSalesNumber
|
||||
FROM
|
||||
tb_product_sku sku
|
||||
LEFT JOIN tb_product pro ON sku.product_id = pro.id
|
||||
tb_product pro
|
||||
LEFT JOIN tb_product_sku sku ON pro.id = sku.product_id
|
||||
WHERE
|
||||
pro.type_enum = 'group'
|
||||
GROUP BY
|
||||
sku.product_id
|
||||
ORDER BY
|
||||
@@ -408,15 +410,17 @@
|
||||
</select>
|
||||
<select id="selectDay" resultType="com.chaozhanggui.system.cashierservice.entity.vo.HomeVO">
|
||||
SELECT
|
||||
pro.id as id,
|
||||
pro.`name` as productName,
|
||||
pro.cover_img as image,
|
||||
sku.origin_price as originPrice,
|
||||
sku.sale_price as salePrice,
|
||||
MAX(sku.real_sales_number) AS realSalesNumber
|
||||
pro.id AS id,
|
||||
pro.`name` AS productName,
|
||||
pro.cover_img AS image,
|
||||
sku.origin_price AS originPrice,
|
||||
sku.sale_price AS salePrice,
|
||||
MAX( sku.real_sales_number ) AS realSalesNumber
|
||||
FROM
|
||||
tb_product_sku sku
|
||||
LEFT JOIN tb_product pro ON sku.product_id = pro.id
|
||||
tb_product pro
|
||||
LEFT JOIN tb_product_sku sku ON pro.id = sku.product_id
|
||||
WHERE
|
||||
pro.type_enum = 'group'
|
||||
GROUP BY
|
||||
sku.product_id
|
||||
ORDER BY
|
||||
|
||||
@@ -21,6 +21,14 @@
|
||||
id
|
||||
, coupon_id, date_used, available_time, booking_type, refund_policy, usage_rules, invoice_info, group_pur_info, market_price_Info, discount_Info, platform_tips </sql>
|
||||
|
||||
<select id="queryById" resultMap="TbPurchaseNoticeMap">
|
||||
select
|
||||
<include refid="Base_Column_List"/>
|
||||
|
||||
from tb_purchase_notice
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<!--查询单个-->
|
||||
<select id="queryByCouponId" resultMap="TbPurchaseNoticeMap">
|
||||
select
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
<mapper namespace="com.chaozhanggui.system.cashierservice.dao.TbUserInfoMapper">
|
||||
<resultMap id="BaseResultMap" type="com.chaozhanggui.system.cashierservice.entity.TbUserInfo">
|
||||
<id column="id" jdbcType="INTEGER" property="id" />
|
||||
<id column="user_id" jdbcType="INTEGER" property="userId" />
|
||||
<result column="amount" jdbcType="DECIMAL" property="amount" />
|
||||
<result column="charge_amount" jdbcType="DECIMAL" property="chargeAmount" />
|
||||
<result column="line_of_credit" jdbcType="DECIMAL" property="lineOfCredit" />
|
||||
@@ -51,7 +50,7 @@
|
||||
<result column="password" jdbcType="VARCHAR" property="password" />
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
id,user_id, amount, charge_amount, line_of_credit, consume_amount, consume_number, total_score,
|
||||
id, amount, charge_amount, line_of_credit, consume_amount, consume_number, total_score,
|
||||
lock_score, card_no, card_password, level_id, head_img, nick_name, telephone, wx_ma_app_id,
|
||||
birth_day, sex, mini_app_open_id, open_id, union_id, code, type, identify, status,
|
||||
parent_id, parent_level, parent_type, project_id, merchant_id, is_resource, is_online,
|
||||
@@ -71,7 +70,7 @@
|
||||
</delete>
|
||||
|
||||
<insert id="insert" parameterType="com.chaozhanggui.system.cashierservice.entity.TbUserInfo" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into tb_user_info (id,user_id, amount, charge_amount,
|
||||
insert into tb_user_info (id, amount, charge_amount,
|
||||
line_of_credit, consume_amount, consume_number,
|
||||
total_score, lock_score, card_no,
|
||||
card_password, level_id, head_img,
|
||||
@@ -87,7 +86,7 @@
|
||||
last_log_in_at, last_leave_at, created_at,
|
||||
updated_at, bind_parent_at, grand_parent_id,password
|
||||
)
|
||||
values (#{id,jdbcType=INTEGER},#{userId,jdbcType=INTEGER}, #{amount,jdbcType=DECIMAL}, #{chargeAmount,jdbcType=DECIMAL},
|
||||
values (#{id,jdbcType=INTEGER}, #{amount,jdbcType=DECIMAL}, #{chargeAmount,jdbcType=DECIMAL},
|
||||
#{lineOfCredit,jdbcType=DECIMAL}, #{consumeAmount,jdbcType=DECIMAL}, #{consumeNumber,jdbcType=INTEGER},
|
||||
#{totalScore,jdbcType=INTEGER}, #{lockScore,jdbcType=INTEGER}, #{cardNo,jdbcType=VARCHAR},
|
||||
#{cardPassword,jdbcType=VARCHAR}, #{levelId,jdbcType=VARCHAR}, #{headImg,jdbcType=VARCHAR},
|
||||
@@ -110,9 +109,6 @@
|
||||
<if test="id != null">
|
||||
id,
|
||||
</if>
|
||||
<if test="userId != null and userId != ''">
|
||||
user_id,
|
||||
</if>
|
||||
<if test="amount != null">
|
||||
amount,
|
||||
</if>
|
||||
@@ -253,9 +249,6 @@
|
||||
<if test="id != null">
|
||||
#{id,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="userId != null and userId != ''">
|
||||
#{userId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="amount != null">
|
||||
#{amount,jdbcType=DECIMAL},
|
||||
</if>
|
||||
@@ -396,9 +389,6 @@
|
||||
<update id="updateByPrimaryKeySelective" parameterType="com.chaozhanggui.system.cashierservice.entity.TbUserInfo">
|
||||
update tb_user_info
|
||||
<set>
|
||||
<if test="userId != null and userId != ''">
|
||||
user_id = #{userId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="amount != null">
|
||||
amount = #{amount,jdbcType=DECIMAL},
|
||||
</if>
|
||||
@@ -539,7 +529,7 @@
|
||||
</update>
|
||||
<update id="updateByPrimaryKey" parameterType="com.chaozhanggui.system.cashierservice.entity.TbUserInfo">
|
||||
update tb_user_info
|
||||
set user_id = #{userId,jdbcType=INTEGER},
|
||||
set
|
||||
amount = #{amount,jdbcType=DECIMAL},
|
||||
charge_amount = #{chargeAmount,jdbcType=DECIMAL},
|
||||
line_of_credit = #{lineOfCredit,jdbcType=DECIMAL},
|
||||
@@ -593,9 +583,6 @@
|
||||
select * from tb_user_info where mini_app_open_id=#{openId}
|
||||
</select>
|
||||
|
||||
<select id="selectUserByPhone" resultMap="BaseResultMap">
|
||||
select * from tb_user_info where telephone=#{phone} AND source_path=#{source}
|
||||
</select>
|
||||
|
||||
<select id="selectByPhone" resultMap="BaseResultMap">
|
||||
select * from tb_user_info where telephone=#{phone}
|
||||
|
||||
Reference in New Issue
Block a user