96 lines
2.8 KiB
XML
96 lines
2.8 KiB
XML
<?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.UserPackageDetailDao">
|
|
|
|
<select id="findDetailUsedQuantity" resultType="com.sqx.modules.bl.order.entity.UserPackageDetail">
|
|
select
|
|
a.massage_type_id,
|
|
a.title,
|
|
a.massage_img,
|
|
a.package_price,
|
|
a.price,
|
|
(case a.status when 1 then 1 else 0 end) as usedQuantity,
|
|
(case a.status when 0 then 1 else 0 end) as unUsedQuantity
|
|
from bl_user_package_detail a
|
|
where a.main_id = #{mainId}
|
|
group by a.massage_type_id,a.title,a.massage_img,a.package_price,a.price
|
|
order by a.massage_type_id
|
|
</select>
|
|
|
|
<select id="findMassagePackageDetails" resultType="com.sqx.modules.bl.order.entity.UserPackageDetail">
|
|
select
|
|
a.service_count,
|
|
a.id as package_detail_id,
|
|
a.massage_type_id,
|
|
0 as status,
|
|
a.package_price,
|
|
a.interval_days,
|
|
b.title,
|
|
b.massage_img,
|
|
b.content,
|
|
b.old_price,
|
|
b.price,
|
|
b.duration,
|
|
b.is_sex,
|
|
b.city,
|
|
b.content_img,
|
|
b.labels,
|
|
b.parent_id,
|
|
b.classify_id,
|
|
b.apply_people,
|
|
b.jianjie
|
|
from bl_massage_package_detail a inner join massage_type b on a.massage_type_id = b.massage_type_id and b.status = 1
|
|
where a.main_id = #{mainId}
|
|
order by a.id
|
|
</select>
|
|
|
|
<insert id="insert" parameterType="com.sqx.modules.bl.order.entity.UserPackageDetail">
|
|
INSERT INTO bl_user_package_detail(
|
|
main_id,
|
|
package_detail_id,
|
|
massage_type_id,
|
|
status,
|
|
package_price,
|
|
interval_days,
|
|
create_time,
|
|
title,
|
|
massage_img,
|
|
content,
|
|
old_price,
|
|
price,
|
|
duration,
|
|
is_sex,
|
|
city,
|
|
content_img,
|
|
labels,
|
|
parent_id,
|
|
classify_id,
|
|
apply_people,
|
|
jianjie
|
|
)values(
|
|
#{mainId},
|
|
#{packageDetailId},
|
|
#{massageTypeId},
|
|
#{status},
|
|
#{packagePrice},
|
|
#{intervalDays},
|
|
#{createTime},
|
|
#{title},
|
|
#{massageImg},
|
|
#{content},
|
|
#{oldPrice},
|
|
#{price},
|
|
#{duration},
|
|
#{isSex},
|
|
#{city},
|
|
#{contentImg},
|
|
#{labels},
|
|
#{parentId},
|
|
#{classifyId},
|
|
#{applyPeople},
|
|
#{jianjie}
|
|
)
|
|
</insert>
|
|
|
|
</mapper> |