From f7ea5773570beb5ad8c6efb5c1cf743294ee079b Mon Sep 17 00:00:00 2001
From: wzy <wzy19931122ai@163.com>
Date: Sun, 24 Jan 2021 14:16:04 +0800
Subject: [PATCH] modify

---
 zq-erp/src/main/resources/mybatis/mapper/hive/SysProjServicesDao.xml |  213 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 211 insertions(+), 2 deletions(-)

diff --git a/zq-erp/src/main/resources/mybatis/mapper/hive/SysProjServicesDao.xml b/zq-erp/src/main/resources/mybatis/mapper/hive/SysProjServicesDao.xml
index e608194..f5b7550 100644
--- a/zq-erp/src/main/resources/mybatis/mapper/hive/SysProjServicesDao.xml
+++ b/zq-erp/src/main/resources/mybatis/mapper/hive/SysProjServicesDao.xml
@@ -38,6 +38,8 @@
 			<result property="oldShopId" column="OLD_SHOP_ID"/>
 			<result property="consumeTime" column="consume_time"/>
 			<result property="companyId" column="company_id"/>
+			<result property="comment" column="comment"/>
+			<result property="reply" column="reply"/>
 
 			
 			<result property="beautiName" column="beautiName"/>
@@ -87,7 +89,9 @@
 			CHANGE_ID,
 			OLD_SHOP_ID,
 			consume_time,
-			company_id
+			company_id,
+			comment,
+			reply
 		)
 	VALUES (
 			#{id},
@@ -122,7 +126,9 @@
 			#{changeId},
 			#{oldShopId},
 			#{consumeTime},
-			#{companyId}
+			#{companyId},
+			#{comment},
+			#{reply}
 	)
 		
 	</insert>
@@ -228,8 +234,18 @@
 				<if test="consumeTime != null  ">
 					consume_time = #{consumeTime}
 				</if>
+
+				<if test="reply != null  ">
+					reply = #{reply}
+				</if>
+				<if test="comment != null  ">
+					comment = #{comment}
+				</if>
 		</set>
 		WHERE id=#{id} 
+	</update>
+	<update id="comment">
+
 	</update>
 
 	<!-- 批量删除 -->
@@ -458,4 +474,197 @@
 		</if>
 	</select>
 
+	<resultMap id="ServiceOrderListVoMap" type="com.matrix.system.app.vo.ServiceOrderListVo">
+		<id column="id" property="id" />
+		<result column="serviceNo" property="serviceNo"/>
+		<result property="time" column="time"/>
+		<result property="bed" column="bed" />
+		<result property="vipName" column="vipName" />
+		<result property="vipId" column="vipId" />
+		<result property="timeLength" column="timeLength" />
+		<result property="status" column="status" />
+		<result property="createStaffId" column="createStaffId" />
+		<result property="shopName" column="shop_short_name" />
+		<collection property="projs" ofType="com.matrix.system.app.vo.ServiceOrderListProjVo">
+			<result property="projName" column="projName" />
+			<result property="beautyName" column="beautyName" />
+			<result property="id" column="staffId" />
+		</collection>
+	</resultMap>
+
+
+	<select id="selectApiServiceOrderListInPage" resultMap="ServiceOrderListVoMap">
+		select
+		   a.id id,
+		   a.SERVICE_NO serviceNo,
+		   a.YY_TIME time,
+		   a.TOTAL_TIME timeLength,
+		   a.state status,
+		   a.create_staff_id createStaffId,
+		   d.BED_NAME bed,
+		   e.VIP_NAME vipName,
+		   e.id vipId,
+		   b.staff_id staffId,
+		   f.su_name beautyName,
+		   g.proj_name projName,
+		   h.shop_short_name
+		from sys_proj_services a
+		left join sys_beautician_state b on a.ID=b.SERVICES_ID
+		left join sys_bed_state c on a.ID = c.SERVICE_ID
+		left join sys_bed_info d on c.BED_ID=d.ID
+		left join sys_vip_info e on a.VIP_ID=e.ID
+		left join sys_users f on f.su_id=b.STAFF_ID
+		left join sys_proj_use g on b.puse_id=g.ID
+		left join sys_shop_info h on a.SHOP_ID=h.ID
+		<where>
+			<if test="record.queryKey != null and record.queryKey != ''">
+				and (instr(a.SERVICE_NO, #{record.queryKey}) or instr(e.phone, #{record.queryKey}) or instr(e.vip_name, #{record.queryKey}) )
+			</if>
+			<if test="record.vipId != null and record.vipId != ''">
+				and a.vip_id = #{record.vipId}
+			</if>
+			<if test="record.status != null and record.status != ''">
+				and a.state = #{record.status}
+			 </if>
+			<if test="record.shopId != null">
+				and a.shop_id=#{record.shopId}
+			</if>
+			<if test="record.userId!=null">
+				and (a.create_staff_id=#{record.userId} or b.staff_id=#{record.userId})
+			</if>
+
+		</where>
+		<if test="pageVo !=null"><!-- 判断pageVo对象是否为空 -->
+			order by a.yy_time desc
+			<if test="pageVo.offset >=0  and pageVo.limit >0">
+				limit
+				#{pageVo.offset},#{pageVo.limit}
+			</if>
+		</if>
+	</select>
+
+	<select id="selectApiServiceOrderListTotal" resultType="java.lang.Integer">
+		select count(1)
+		from sys_proj_services a
+		left join sys_beautician_state b on a.ID=b.SERVICES_ID
+		left join sys_bed_state c on a.ID = c.SERVICE_ID
+		left join sys_bed_info d on c.BED_ID=d.ID
+		left join sys_vip_info e on a.VIP_ID=e.ID
+		left join sys_users f on f.su_id=b.STAFF_ID
+		left join sys_proj_use g on b.puse_id=g.ID
+		<where>
+			<if test="record.queryKey != null and record.queryKey != ''">
+				and (instr(a.SERVICE_NO, #{record.queryKey}) or instr(e.phone, #{record.queryKey}) or instr(e.vip_name, #{record.queryKey}) )
+			</if>
+			<if test="record.status != null and record.status != ''">
+				and a.state = #{record.status}
+			</if>
+			<if test="record.shopId != null">
+				and a.shop_id=#{record.shopId}
+			</if>
+			<if test="record.userId!=null">
+				and (a.create_staff_id=#{record.userId} or b.staff_id=#{record.userId})
+			</if>
+		</where>
+	</select>
+
+
+
+
+	<resultMap id="ErpServiceOrderListVoMap" type="com.matrix.system.shopXcx.api.vo.ErpServiceOrderListVo">
+		<id column="id" property="id" />
+		<result column="serviceNo" property="serviceNo"/>
+		<result property="time" column="time"/>
+		<result property="bed" column="bed" />
+		<result property="timeLength" column="timeLength" />
+		<result property="status" column="status" />
+		<result property="shopName" column="shopName" />
+		<result property="shopAddr" column="shopAddr" />
+		<result property="comment" column="comment" />
+		<result property="reply" column="reply" />
+		<collection property="projs" ofType="com.matrix.system.shopXcx.api.vo.ErpServiceOrderListProjVo">
+			<result property="projName" column="projName" />
+			<result property="beautyName" column="beautyName" />
+			<result property="imgMobile" column="imgMobile" />
+		</collection>
+	</resultMap>
+    <select id="findWxServiceOrderList" resultMap="ErpServiceOrderListVoMap">
+		select
+		a.id id,
+		a.SERVICE_NO serviceNo,
+		a.YY_TIME time,
+		a.TOTAL_TIME timeLength,
+		a.state status,
+		d.BED_NAME bed,
+		f.su_name beautyName,
+		g.proj_name projName,
+		h.shop_short_name as shopName,
+		h.shop_addr as shopAddr,
+		m.img as imgMobile
+		from sys_proj_services a
+		left join sys_beautician_state b on a.ID=b.SERVICES_ID
+		left join sys_bed_state c on a.ID = c.SERVICE_ID
+		left join sys_bed_info d on c.BED_ID=d.ID
+		left join sys_vip_info e on a.VIP_ID=e.ID
+		left join sys_users f on f.su_id=b.STAFF_ID
+		left join sys_proj_use g on b.puse_id=g.ID
+		left join sys_shop_info h on a.SHOP_ID=h.ID
+		left join shopping_goods m on g.proj_id=m.id
+		<where>
+			<if test="queryKey != null and queryKey != ''">
+				and instr(a.SERVICE_NO, #{queryKey})
+			</if>
+			<if test="vipId != null and vipId != ''">
+				and a.vip_id = #{vipId}
+			</if>
+			<if test="vipStatus != null and vipStatus != '' and vipStatus!=0 ">
+				<if test="vipStatus == 1">
+					and a.state = '待确认'
+				</if>
+				<if test="vipStatus == 2">
+					and a.state in ( '预约成功待处理' ,'需配料','配料完成','服务中')
+				</if>
+				<if test="vipStatus == 3">
+					and ( a.state in ( '服务完成' ,'服务单结束') and a.comment is  null)
+				</if>
+				<if test="vipStatus == 4">
+					and a.comment is not null
+				</if>
+				<if test="vipStatus == 5">
+					and a.state = '预约取消'
+				</if>
+			</if>
+		</where>
+			order by a.yy_time desc
+			limit #{offset}, #{limit}
+	</select>
+	<select id="findWxServiceOrderById" resultMap="ErpServiceOrderListVoMap">
+		select
+		a.id id,
+		a.SERVICE_NO serviceNo,
+		a.YY_TIME time,
+		a.TOTAL_TIME timeLength,
+		a.state status,
+		a.comment,
+		a.reply,
+		d.BED_NAME bed,
+		f.su_name beautyName,
+		g.proj_name projName,
+		h.shop_short_name as shopName,
+		h.shop_addr as shopAddr,
+		m.img as imgMobile
+		from sys_proj_services a
+		left join sys_beautician_state b on a.ID=b.SERVICES_ID
+		left join sys_bed_state c on a.ID = c.SERVICE_ID
+		left join sys_bed_info d on c.BED_ID=d.ID
+		left join sys_vip_info e on a.VIP_ID=e.ID
+		left join sys_users f on f.su_id=b.STAFF_ID
+		left join sys_proj_use g on b.puse_id=g.ID
+		left join sys_shop_info h on a.SHOP_ID=h.ID
+		left join shopping_goods m on g.proj_id=m.id
+		where a.id=#{id}
+	</select>
+
+
+
 </mapper>

--
Gitblit v1.9.1