Commit dcbd505f by huluobin

update

parent e9f673e9
package com.gogirl.application.product.serve.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.gogirl.application.product.serve.BaseServeService;
import com.gogirl.domain.market.discount.LeisureDiscountConfig;
import com.gogirl.domain.product.serve.BaseProduce;
import com.gogirl.domain.product.serve.BaseServe;
import com.gogirl.infrastructure.mapper.market.discount.LeisureDiscountConfigMapper;
import com.gogirl.infrastructure.mapper.product.serve.BaseProduceMapper;
import com.gogirl.infrastructure.mapper.product.serve.BaseServeMapper;
import com.gogirl.infrastructure.mapper.product.serve.ProducePromotionTimeMapper;
import lombok.AllArgsConstructor;
......@@ -21,6 +24,7 @@ public class BaseServeServiceImpl extends ServiceImpl<BaseServeMapper, BaseServe
private final BaseServeMapper baseServeMapper;
private final LeisureDiscountConfigMapper leisureDiscountConfigMapper;
private final BaseProduceMapper baseProduceMapper;
@Override
......@@ -32,7 +36,12 @@ public class BaseServeServiceImpl extends ServiceImpl<BaseServeMapper, BaseServe
@Override
public BaseServe getAggregate(Integer id, LocalDateTime date, Integer departmentId) {
BaseServe baseServe = baseServeMapper.getAggregate(id);
BaseServe baseServe = baseServeMapper.selectById(id);
List<BaseProduce> baseProduceList = baseProduceMapper.selectList(new LambdaQueryWrapper<BaseProduce>()
.eq(BaseProduce::getServiceId, baseServe.getId()));
baseServe.setListProduce(baseProduceList);
if (date != null) {
LeisureDiscountConfig leisureDiscountConfig = leisureDiscountConfigMapper.selectLeisureDiscount(id,
date.toLocalTime().toString(),
......
......@@ -21,5 +21,4 @@ public interface BaseServeMapper extends BaseMapper<BaseServe> {
IPage<BaseServe> listLeisureServeForPage(@Param("page") IPage<BaseServe> page, @Param("baseServe") BaseServe baseServe, @Param("serveIdList") List<Integer> serveIdList, @Param("time") String time, @Param("week") Integer week);
BaseServe getAggregate(Integer id);
}
......@@ -3,123 +3,138 @@
"http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.gogirl.infrastructure.mapper.product.serve.BaseServeMapper">
<resultMap id="ServerWithProduce" type="com.gogirl.domain.product.serve.BaseServe">
<result column="id" property="id"/>
<result column="name" property="name"/>
<result column="type" property="type"/>
<result column="type_id" property="typeId"/>
<result column="label" property="label"/>
<result column="shop_sort" property="shopSort"/>
<result column="price" property="price"/>
<result column="picture_path" property="picturePath"/>
<result column="status" property="status"/>
<result column="remark" property="remark"/>
<result column="details" property="details"/>
<result column="service_duration" property="serviceDuration"/>
<result column="has_index_show" property="hasIndexShow"/>
<result column="index_sort" property="indexSort"/>
<result column="praise_sum" property="praiseSum"/>
<result column="brief_introduction" property="briefIntroduction"/>
<result column="sch_type_id" property="schTypeId"/>
<association property="produce" javaType="com.gogirl.domain.product.serve.BaseProduce">
<result column="produce_id" property="id"/>
<result column="produce_name" property="name"/>
<result column="produce_picture_path" property="picturePath"/>
<result column="produce_type" property="type"/>
<result column="produce_label" property="label"/>
<result column="produce_shop_sort" property="shopSort"/>
<result column="reqduce_grade" property="reqGrade"/>
<result column="produce_status" property="status"/>
<result column="produce_remark" property="remark"/>
</association>
<collection property="listProduce" ofType="com.gogirl.domain.product.serve.BaseProduce">
<result column="pro_id" property="id"/>
<result column="pro_name" property="name"/>
<result column="pro_picture_path" property="picturePath"/>
<result column="pro_type" property="type"/>
<result column="pro_label" property="label"/>
<result column="pro_shop_sort" property="shopSort"/>
<result column="req_grade" property="reqGrade"/>
<result column="pro_status" property="status"/>
<result column="pro_remark" property="remark"/>
<result column="pro_praise_sum" property="praiseSum"/>
<result column="pro_current_price" property="currentPrice"/>
<result column="pro_bargain_price" property="bargainPrice"/>
<result column="pro_service_duration" property="serviceDuration"/>
<result column="pro_brief_introduction" property="briefIntroduction"/>
<result column="pro_details" property="details"/>
</collection>
<collection property="praiseRecord" ofType="com.gogirl.domain.product.serve.PraiseRecord">
<id column="praiseid" property="id" jdbcType="INTEGER"/>
<result column="praisecustomer_id" property="customerId" jdbcType="INTEGER"/>
<result column="praiseserve_id" property="serveId" jdbcType="INTEGER"/>
<result column="praisetime" property="time" jdbcType="TIMESTAMP"/>
</collection>
<collection property="listLabel" ofType="com.gogirl.domain.product.serve.Label">
<result column="lid" property="id" jdbcType="INTEGER"/>
<result column="lname" property="name" jdbcType="VARCHAR"/>
<result column="lpic_url" property="picUrl" jdbcType="VARCHAR"/>
</collection>
</resultMap>
<!-- <resultMap id="ServerWithProduce" type="com.gogirl.domain.product.serve.BaseServe">-->
<!-- <result column="id" property="id"/>-->
<!-- <result column="name" property="name"/>-->
<!-- <result column="type" property="type"/>-->
<!-- <result column="type_id" property="typeId"/>-->
<!-- <result column="label" property="label"/>-->
<!-- <result column="shop_sort" property="shopSort"/>-->
<!-- <result column="price" property="price"/>-->
<!-- <result column="picture_path" property="picturePath"/>-->
<!-- <result column="status" property="status"/>-->
<!-- <result column="remark" property="remark"/>-->
<!-- <result column="details" property="details"/>-->
<!-- <result column="service_duration" property="serviceDuration"/>-->
<!-- <result column="has_index_show" property="hasIndexShow"/>-->
<!-- <result column="index_sort" property="indexSort"/>-->
<!-- <result column="praise_sum" property="praiseSum"/>-->
<!-- <result column="brief_introduction" property="briefIntroduction"/>-->
<!-- <result column="sch_type_id" property="schTypeId"/>-->
<!-- <association property="produce" javaType="com.gogirl.domain.product.serve.BaseProduce">-->
<!-- <result column="produce_id" property="id"/>-->
<!-- <result column="produce_name" property="name"/>-->
<!-- <result column="produce_picture_path" property="picturePath"/>-->
<!-- <result column="produce_type" property="type"/>-->
<!-- <result column="produce_label" property="label"/>-->
<!-- <result column="produce_shop_sort" property="shopSort"/>-->
<!-- <result column="reqduce_grade" property="reqGrade"/>-->
<!-- <result column="produce_status" property="status"/>-->
<!-- <result column="produce_remark" property="remark"/>-->
<!-- </association>-->
<!-- <collection property="listProduce" ofType="com.gogirl.domain.product.serve.BaseProduce">-->
<!-- <result column="pro_id" property="id"/>-->
<!-- <result column="pro_name" property="name"/>-->
<!-- <result column="pro_picture_path" property="picturePath"/>-->
<!-- <result column="pro_type" property="type"/>-->
<!-- <result column="pro_label" property="label"/>-->
<!-- <result column="pro_shop_sort" property="shopSort"/>-->
<!-- <result column="req_grade" property="reqGrade"/>-->
<!-- <result column="pro_status" property="status"/>-->
<!-- <result column="pro_remark" property="remark"/>-->
<!-- <result column="pro_praise_sum" property="praiseSum"/>-->
<!-- <result column="pro_current_price" property="currentPrice"/>-->
<!-- <result column="pro_bargain_price" property="bargainPrice"/>-->
<!-- <result column="pro_service_duration" property="serviceDuration"/>-->
<!-- <result column="pro_brief_introduction" property="briefIntroduction"/>-->
<!-- <result column="pro_details" property="details"/>-->
<!-- </collection>-->
<!-- <collection property="praiseRecord" ofType="com.gogirl.domain.product.serve.PraiseRecord">-->
<!-- <id column="praiseid" property="id" jdbcType="INTEGER"/>-->
<!-- <result column="praisecustomer_id" property="customerId" jdbcType="INTEGER"/>-->
<!-- <result column="praiseserve_id" property="serveId" jdbcType="INTEGER"/>-->
<!-- <result column="praisetime" property="time" jdbcType="TIMESTAMP"/>-->
<!-- </collection>-->
<!-- <collection property="listLabel" ofType="com.gogirl.domain.product.serve.Label">-->
<!-- <result column="lid" property="id" jdbcType="INTEGER"/>-->
<!-- <result column="lname" property="name" jdbcType="VARCHAR"/>-->
<!-- <result column="lpic_url" property="picUrl" jdbcType="VARCHAR"/>-->
<!-- </collection>-->
<!-- </resultMap>-->
<resultMap id="ServerWithProduceForPage" type="com.gogirl.domain.product.serve.BaseServe">
<result column="id" property="id"/>
<result column="name" property="name"/>
<result column="type" property="type"/>
<result column="type_id" property="typeId"/>
<result column="label" property="label"/>
<result column="shop_sort" property="shopSort"/>
<result column="price" property="price"/>
<result column="picture_path" property="picturePath"/>
<result column="status" property="status"/>
<result column="remark" property="remark"/>
<result column="details" property="details"/>
<result column="service_duration" property="serviceDuration"/>
<result column="has_index_show" property="hasIndexShow"/>
<result column="index_sort" property="indexSort"/>
<result column="praise_sum" property="praiseSum"/>
<result column="brief_introduction" property="briefIntroduction"/>
<result column="sch_type_id" property="schTypeId"/>
<association property="produce" javaType="com.gogirl.domain.product.serve.BaseProduce">
<result column="produce_id" property="id"/>
<result column="produce_name" property="name"/>
<result column="produce_picture_path" property="picturePath"/>
<result column="produce_type" property="type"/>
<result column="produce_label" property="label"/>
<result column="produce_shop_sort" property="shopSort"/>
<result column="reqduce_grade" property="reqGrade"/>
<result column="produce_status" property="status"/>
<result column="produce_remark" property="remark"/>
</association>
<collection property="listProduce" ofType="com.gogirl.domain.product.serve.BaseProduce" column="id"
select="listProduceByServeId">
</collection>
<collection property="praiseRecord" ofType="com.gogirl.domain.product.serve.PraiseRecord">
<id column="praiseid" property="id" jdbcType="INTEGER"/>
<result column="praisecustomer_id" property="customerId" jdbcType="INTEGER"/>
<result column="praiseserve_id" property="serveId" jdbcType="INTEGER"/>
<result column="praisetime" property="time" jdbcType="TIMESTAMP"/>
</collection>
</resultMap>
<!-- <resultMap id="ServerWithProduceForPage" type="com.gogirl.domain.product.serve.BaseServe">-->
<!-- <result column="id" property="id"/>-->
<!-- <result column="name" property="name"/>-->
<!-- <result column="type" property="type"/>-->
<!-- <result column="type_id" property="typeId"/>-->
<!-- <result column="label" property="label"/>-->
<!-- <result column="shop_sort" property="shopSort"/>-->
<!-- <result column="price" property="price"/>-->
<!-- <result column="picture_path" property="picturePath"/>-->
<!-- <result column="status" property="status"/>-->
<!-- <result column="remark" property="remark"/>-->
<!-- <result column="details" property="details"/>-->
<!-- <result column="service_duration" property="serviceDuration"/>-->
<!-- <result column="has_index_show" property="hasIndexShow"/>-->
<!-- <result column="index_sort" property="indexSort"/>-->
<!-- <result column="praise_sum" property="praiseSum"/>-->
<!-- <result column="brief_introduction" property="briefIntroduction"/>-->
<!-- <result column="sch_type_id" property="schTypeId"/>-->
<!-- <association property="produce" javaType="com.gogirl.domain.product.serve.BaseProduce">-->
<!-- <result column="produce_id" property="id"/>-->
<!-- <result column="produce_name" property="name"/>-->
<!-- <result column="produce_picture_path" property="picturePath"/>-->
<!-- <result column="produce_type" property="type"/>-->
<!-- <result column="produce_label" property="label"/>-->
<!-- <result column="produce_shop_sort" property="shopSort"/>-->
<!-- <result column="reqduce_grade" property="reqGrade"/>-->
<!-- <result column="produce_status" property="status"/>-->
<!-- <result column="produce_remark" property="remark"/>-->
<!-- </association>-->
<!-- <collection property="listProduce" ofType="com.gogirl.domain.product.serve.BaseProduce" column="id"-->
<!-- select="listProduceByServeId">-->
<!-- </collection>-->
<!-- <collection property="praiseRecord" ofType="com.gogirl.domain.product.serve.PraiseRecord">-->
<!-- <id column="praiseid" property="id" jdbcType="INTEGER"/>-->
<!-- <result column="praisecustomer_id" property="customerId" jdbcType="INTEGER"/>-->
<!-- <result column="praiseserve_id" property="serveId" jdbcType="INTEGER"/>-->
<!-- <result column="praisetime" property="time" jdbcType="TIMESTAMP"/>-->
<!-- </collection>-->
<!-- </resultMap>-->
<resultMap id="produceResultMap" type="com.gogirl.domain.product.serve.BaseProduce">
<result column="pro_id" property="id"/>
<result column="pro_name" property="name"/>
<result column="pro_picture_path" property="picturePath"/>
<result column="pro_type" property="type"/>
<result column="pro_label" property="label"/>
<result column="pro_shop_sort" property="shopSort"/>
<result column="req_grade" property="reqGrade"/>
<result column="pro_status" property="status"/>
<result column="pro_remark" property="remark"/>
</resultMap>
<!-- <resultMap id="produceResultMap" type="com.gogirl.domain.product.serve.BaseProduce">-->
<!-- <result column="pro_id" property="id"/>-->
<!-- <result column="pro_name" property="name"/>-->
<!-- <result column="pro_picture_path" property="picturePath"/>-->
<!-- <result column="pro_type" property="type"/>-->
<!-- <result column="pro_label" property="label"/>-->
<!-- <result column="pro_shop_sort" property="shopSort"/>-->
<!-- <result column="req_grade" property="reqGrade"/>-->
<!-- <result column="pro_status" property="status"/>-->
<!-- <result column="pro_remark" property="remark"/>-->
<!-- </resultMap>-->
<sql id="baseSql">
id, name,type,type_id, label, shop_sort, price, picture_path, status, remark, details, service_duration,brief_introduction,sch_type_id
</sql>
<sql id="serveSql">
ser.id, ser.name,ser.type,ser.type_id, ser.label, ser.shop_sort, ser.price, ser.picture_path, ser.status, ser.remark, ser.details,
ser.service_duration, ser.has_index_show, ser.index_sort, ser.praise_sum,ser.brief_introduction,ser.sch_type_id
ser.id,
ser.name,
ser.type,
ser.type_id,
ser.label,
ser.shop_sort,
ser.price,
ser.picture_path,
ser.status,
ser.remark,
ser.details,
ser.service_duration,
ser.has_index_show,
ser.index_sort,
ser.praise_sum,
ser.brief_introduction,
ser.sch_type_id
</sql>
<sql id="praiseSql">
praise.id praiseid,praise.customer_id praisecustomer_id,praise.serve_id praiseserve_id,praise.time praisetime
......@@ -144,18 +159,7 @@
</sql>
<select id="getAggregate" resultMap="ServerWithProduce">
select
<include refid="serveSql"/>,
<include refid="proSql"/>,
<include refid="labelSql"/>
from base_serve ser
left join base_produce pro on pro.service_id = ser.id
left join label_relation lsr on ser.id = lsr.main_id and lsr.type=1
left join label l on l.id = lsr.label_id
where
ser.id = #{id}
</select>
<select id="listServeForPage" resultType="com.gogirl.domain.product.serve.BaseServe">
......@@ -210,5 +214,14 @@
group by ser.id
order by ser.purchase_show_index desc
</select>
<select id="selectLabel" resultType="com.gogirl.domain.product.serve.Label">
select
l.*
from base_serve ser
left join label_relation lsr on ser.id = lsr.main_id and lsr.type=1
left join label l on l.id = lsr.label_id
where
ser.id = #{id}
</select>
</mapper>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment