sadjv3_java/src/main/resources/mapper/bl/order/UserPackageDao.xml

153 lines
4.3 KiB
XML
Raw Normal View History

2024-06-08 22:08:01 +08:00
<?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.sqx.modules.bl.order.dao.UserPackageDao">
<select id="findList" resultType="com.sqx.modules.bl.order.entity.UserPackage">
select
id,
user_id,
package_id,
orders_id,
orders_no,
create_time,
2024-06-13 23:27:06 +08:00
status,
title,
type,
old_price,
price,
package_img,
content,
content_img,
labels,
2024-06-15 20:39:41 +08:00
city,
classify_id
from bl_user_package
where orders_id = #{ordersId}
order by id
</select>
<select id="findListByMapping" resultType="com.sqx.modules.bl.order.entity.UserPackage">
select
a.id,
a.title,
a.type,
a.old_price,
a.price,
a.package_img,
a.content,
a.content_img,
a.labels,
2024-06-15 20:39:41 +08:00
a.city,
a.classify_id
from bl_massage_package a inner join bl_user_package_order_mapping b on a.id = b.package_id
where b.orders_id = #{ordersId}
order by a.id
</select>
2024-06-15 20:39:41 +08:00
<insert id="insert" useGeneratedKeys="true" keyProperty="id" parameterType="com.sqx.modules.bl.order.entity.UserPackage">
2024-06-08 22:08:01 +08:00
insert into bl_user_package(
user_id,
package_id,
orders_id,
orders_no,
create_time,
title,
type,
old_price,
price,
package_img,
content,
content_img,
labels,
2024-06-15 20:39:41 +08:00
city,
classify_id
2024-06-08 22:08:01 +08:00
)values(
#{userId},
#{packageId},
#{ordersId},
#{ordersNo},
#{createTime},
#{title},
#{type},
#{oldPrice},
#{price},
#{packageImg},
#{content},
#{contentImg},
#{labels},
2024-06-15 20:39:41 +08:00
#{city},
#{classifyId}
2024-06-08 22:08:01 +08:00
)
</insert>
2024-06-13 23:27:06 +08:00
<update id="updateStatusByOrder">
update bl_user_package
set status = #{status}
where orders_id = #{ordersId}
</update>
<select id="findMyPackageList" resultType="com.sqx.modules.bl.order.entity.UserPackage">
select
2024-06-15 20:39:41 +08:00
a.id,
a.user_id,
a.package_id,
a.orders_id,
a.orders_no,
a.create_time,
a.status,
a.title,
a.type,
a.old_price,
a.price,
a.package_img,
a.content,
a.content_img,
a.labels,
a.city,
a.classify_id,
b.value as classifyName,
c.sales,
2024-07-01 23:38:31 +08:00
c.esteem_rate,
(select count(*) from bl_user_package_detail d where d.main_id = a.id) as service_count
2024-06-15 20:39:41 +08:00
from bl_user_package a
left join sys_dict b on a.classify_id = b.id and b.type="服务类型"
left join bl_massage_package c on a.package_id = c.id
where a.user_id = #{params.userId}
and a.type = #{params.type}
<if test="params.title!=null and params.title!=''">
and a.title like concat('%',#{params.title},'%')
</if>
order by a.id desc
</select>
<select id="getMyPackageById" resultType="com.sqx.modules.bl.order.entity.UserPackage">
select
a.id,
a.user_id,
a.package_id,
a.orders_id,
a.orders_no,
a.create_time,
a.status,
a.title,
a.type,
a.old_price,
a.price,
a.package_img,
a.content,
a.content_img,
a.labels,
a.city,
a.classify_id,
b.value as classifyName,
c.sales,
2024-07-01 23:38:31 +08:00
c.esteem_rate,
(select count(*) from bl_user_package_detail d where d.main_id = a.id) as service_count
2024-06-15 20:39:41 +08:00
from bl_user_package a
left join sys_dict b on a.classify_id = b.id and b.type="服务类型"
left join bl_massage_package c on a.package_id = c.id
where a.id = #{id}
2024-06-13 23:27:06 +08:00
</select>
2024-06-08 22:08:01 +08:00
</mapper>