对用户配置文件和菜品配置文件添加功能和注释补充

main
Artyom 2 months ago
parent 6282c54755
commit 7d1157b485

@ -1,19 +1,30 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!-- 定义XML文档的版本和编码 -->
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<!-- 声明这是一个MyBatis的mapper文件并指定DTD文件的位置 -->
<mapper namespace="com.sky.mapper.DishFlavorMapper">
<!-- 定义命名空间通常对应于一个Java接口 -->
<insert id="insertBatch">
insert into dish_flavor (dish_id, name, value) values
<!-- 定义一个插入操作id为insertBatch -->
insert into dish_flavor (dish_id, name, value) values
<!-- 插入数据的SQL语句向dish_flavor表中插入数据 -->
<foreach collection="list" item="flavor" separator=",">
<!-- 使用MyBatis的foreach标签遍历传入的列表 -->
(#{flavor.dishId},#{flavor.name},#{flavor.value})
<!-- 对每个元素进行插入操作,使用#{flavor.dishId}等占位符来引用对象的属性 -->
</foreach>
</insert>
<delete id="deleteByDishIds">
<!-- 定义一个删除操作id为deleteByDishIds -->
delete from dish_flavor where dish_id in
<foreach collection="dishIds" open="(" close=")" separator="," item="dishId">
#{dishId}
</foreach>
<!-- 删除dish_flavor表中满足条件的记录 -->
<foreach collection="dishIds" open="(" close=")" separator="," item="dishId">
<!-- 使用MyBatis的foreach标签遍历传入的dishIds集合 -->
#{dishId}
<!-- 对每个元素进行删除操作,使用#{dishId}占位符来引用集合中的元素 -->
</foreach>
</delete>
</mapper>

@ -1,14 +1,18 @@
<?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" >
<!-- 定义XML文档的版本和编码 -->
<mapper namespace="com.sky.mapper.OrderDetailMapper">
<!-- 指定命名空间通常对应于一个Java接口 -->
<insert id="insertBatch">
<!-- 定义一个插入操作id为insertBatch -->
insert into order_detail(name, image, order_id, dish_id, setmeal_id, dish_flavor, amount)
values
values
<!-- 插入数据的SQL语句向order_detail表中插入数据 -->
<foreach collection="orderDetailList" item="od" separator=",">
<!-- 使用MyBatis的foreach标签遍历传入的orderDetailList集合 -->
(#{od.name},#{od.image},#{od.orderId},#{od.dishId},#{od.setmealId},#{od.dishFlavor},#{od.amount})
<!-- 对每个元素进行插入操作,使用#{od.name}等占位符来引用对象的属性 -->
</foreach>
</insert>
</mapper>

@ -1,23 +1,28 @@
<?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" >
<!-- 定义XML文档的版本和编码 -->
<mapper namespace="com.sky.mapper.OrderMapper">
<!-- 指定命名空间通常对应于一个Java接口 -->
<!-- 插入订单记录 -->
<insert id="insert" useGeneratedKeys="true" keyProperty="id">
insert into orders(number, status, user_id, address_book_id, order_time,
checkout_time, pay_method, pay_status, amount, remark,
phone, address, user_name, consignee, cancel_reason,
rejection_reason, cancel_time, estimated_delivery_time,
delivery_status, delivery_time, pack_amount,
tableware_number, tableware_status)
values(#{number},#{status},#{userId},#{addressBookId},#{orderTime},#{checkoutTime},
#{payMethod},#{payStatus},#{amount},#{remark},#{phone},#{address},#{userName},
#{consignee},#{cancelReason},#{rejectionReason},#{cancelTime},#{estimatedDeliveryTime},
#{deliveryStatus},#{deliveryTime},#{packAmount},#{tablewareNumber},#{tablewareStatus})
insert into orders(number, status, user_id, address_book_id, order_time,
checkout_time, pay_method, pay_status, amount, remark,
phone, address, user_name, consignee, cancel_reason,
rejection_reason, cancel_time, estimated_delivery_time,
delivery_status, delivery_time, pack_amount,
tableware_number, tableware_status)
values(#{number},#{status},#{userId},#{addressBookId},#{orderTime},#{checkoutTime},
#{payMethod},#{payStatus},#{amount},#{remark},#{phone},#{address},#{userName},
#{consignee},#{cancelReason},#{rejectionReason},#{cancelTime},#{estimatedDeliveryTime},
#{deliveryStatus},#{deliveryTime},#{packAmount},#{tablewareNumber},#{tablewareStatus})
</insert>
<!-- 更新订单记录 -->
<update id="update" parameterType="com.sky.entity.Orders">
update orders
<set>
<!-- 根据条件动态更新字段 -->
<if test="cancelReason != null and cancelReason!='' ">
cancel_reason=#{cancelReason},
</if>
@ -45,10 +50,13 @@
</set>
where id = #{id}
</update>
<!-- 分页查询订单 -->
<select id="pageQuery" resultType="com.sky.entity.Orders">
select *
from orders
<where>
<!-- 根据条件动态拼接查询语句 -->
<if test="number != null and number!=''">
and number like concat('%',#{number},'%')
</if>
@ -69,10 +77,13 @@
</if>
</where>
</select>
<!-- 计算订单金额总和 -->
<select id="sumByMap" resultType="java.lang.Double">
select sum(amount)
from orders
<where>
<!-- 根据条件动态拼接查询语句 -->
<if test="begin != null">
and order_time &gt; #{begin}
</if>
@ -84,10 +95,13 @@
</if>
</where>
</select>
<!-- 统计订单数量 -->
<select id="countByMap" resultType="java.lang.Integer">
select count(id)
from orders
<where>
<!-- 根据条件动态拼接查询语句 -->
<if test="begin != null">
and order_time &gt; #{begin}
</if>
@ -99,18 +113,21 @@
</if>
</where>
</select>
<!-- 获取销售前十的商品 -->
<select id="getSalesTop10" resultType="com.sky.dto.GoodsSalesDTO">
select od.name,sum(od.number) as number
from order_detail od,orders o
where
od.order_id = o.id
and o.status = 5
<if test="begin != null">
and o.order_time &gt; #{begin}
</if>
<if test="end != null">
and o.order_time &lt; #{end}
</if>
od.order_id = o.id
and o.status = 5
<!-- 根据条件动态拼接查询语句 -->
<if test="begin != null">
and o.order_time &gt; #{begin}
</if>
<if test="end != null">
and o.order_time &lt; #{end}
</if>
group by od.name
order by number desc
limit 0,10

@ -76,41 +76,49 @@ __webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return staticRenderFns; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "recyclableRender", function() { return recyclableRender; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "components", function() { return components; });
var components
try {
components = {
uniIcons: function() {
return Promise.all(/*! import() | components/uni-icons/uni-icons */[__webpack_require__.e("common/vendor"), __webpack_require__.e("components/uni-icons/uni-icons")]).then(__webpack_require__.bind(null, /*! @/components/uni-icons/uni-icons.vue */ 232))
},
uniBadge: function() {
return __webpack_require__.e(/*! import() | uni_modules/uni-badge/components/uni-badge/uni-badge */ "uni_modules/uni-badge/components/uni-badge/uni-badge").then(__webpack_require__.bind(null, /*! @/uni_modules/uni-badge/components/uni-badge/uni-badge.vue */ 240))
var components // 定义一个变量来存储组件对象
try {
// 尝试动态加载组件
components = {
uniIcons: function() {
// 使用 Promise.all 并行加载多个模块,然后返回 uni-icons 组件
return Promise.all(/*! import() | components/uni-icons/uni-icons */[__webpack_require__.e("common/vendor"), __webpack_require__.e("components/uni-icons/uni-icons")]).then(__webpack_require__.bind(null, /*! @/components/uni-icons/uni-icons.vue */ 232))
},
uniBadge: function() {
// 动态加载 uni-badge 组件
return __webpack_require__.e(/*! import() | uni_modules/uni-badge/components/uni-badge/uni-badge */ "uni_modules/uni-badge/components/uni-badge/uni-badge").then(__webpack_require__.bind(null, /*! @/uni_modules/uni-badge/components/uni-badge/uni-badge.vue */ 240))
}
}
} catch (e) {
// 如果加载组件失败,检查错误信息并给出排查建议
if (
e.message.indexOf("Cannot find module") !== -1 &&
e.message.indexOf(".vue") !== -1
) {
console.error(e.message)
console.error("1. 排查组件名称拼写是否正确")
console.error(
"2. 排查组件是否符合 easycom 规范文档https://uniapp.dcloud.net.cn/collocation/pages?id=easycom"
)
console.error(
"3. 若组件不符合 easycom 规范,需手动引入,并在 components 中注册该组件"
)
} else {
throw e // 如果错误不是找不到模块,则重新抛出错误
}
}
// 渲染函数,用于生成页面的 HTML 结构
var render = function() {
var _vm = this // 获取当前实例
var _h = _vm.$createElement // 创建虚拟节点的方法
var _c = _vm._self._c || _h // 渲染函数的辅助方法
}
}
} catch (e) {
if (
e.message.indexOf("Cannot find module") !== -1 &&
e.message.indexOf(".vue") !== -1
) {
console.error(e.message)
console.error("1. 排查组件名称拼写是否正确")
console.error(
"2. 排查组件是否符合 easycom 规范文档https://uniapp.dcloud.net.cn/collocation/pages?id=easycom"
)
console.error(
"3. 若组件不符合 easycom 规范,需手动引入,并在 components 中注册该组件"
)
} else {
throw e
}
}
var render = function() {
var _vm = this
var _h = _vm.$createElement
var _c = _vm._self._c || _h
}
var recyclableRender = false
var staticRenderFns = []
render._withStripped = true
var recyclableRender = false // 标记是否可回收渲染
var staticRenderFns = [] // 静态渲染函数数组,通常用于优化性能
render._withStripped = true // 标记渲染函数为已剥离(去除调试信息)
@ -436,11 +444,14 @@ __webpack_require__.r(__webpack_exports__);
}]);
//# sourceMappingURL=../../../../../../.sourcemap/mp-weixin/node-modules/@dcloudio/uni-ui/lib/uni-list-item/uni-list-item.js.map
;(global["webpackJsonp"] = global["webpackJsonp"] || []).push([
'node-modules/@dcloudio/uni-ui/lib/uni-list-item/uni-list-item-create-component',
{
'node-modules/@dcloudio/uni-ui/lib/uni-list-item/uni-list-item-create-component':(function(module, exports, __webpack_require__){
__webpack_require__('1')['createComponent'](__webpack_require__(173))
})
},
[['node-modules/@dcloudio/uni-ui/lib/uni-list-item/uni-list-item-create-component']]
'node-modules/@dcloudio/uni-ui/lib/uni-list-item/uni-list-item-create-component', // 模块路径
{
// 定义模块内容
'node-modules/@dcloudio/uni-ui/lib/uni-list-item/uni-list-item-create-component':(function(module, exports, __webpack_require__){
// 使用 createComponent 方法创建组件,传入的参数是 uni-list-item 组件的定义
__webpack_require__('1')['createComponent'](__webpack_require__(173))
})
},
[['node-modules/@dcloudio/uni-ui/lib/uni-list-item/uni-list-item-create-component']] // 依赖项数组
]);

Loading…
Cancel
Save