From d55a92faa794aaa478edf9f16ee45663f007ac4c Mon Sep 17 00:00:00 2001
From: Helius <wangdoubleone@gmail.com>
Date: Sat, 16 Jan 2021 15:30:22 +0800
Subject: [PATCH] Merge branch 'api' of https://gitee.com/jyyforjava/zq-erp into api

---
 zq-erp/src/main/resources/mybatis/mapper/hive/SysProjServicesDao.xml |  138 +++++++++++++++++++++++++++++++++++++++------
 1 files changed, 119 insertions(+), 19 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 8092043..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>
 
 	<!-- 批量删除 -->
@@ -516,23 +532,7 @@
 			<if test="record.userId!=null">
 				and (a.create_staff_id=#{record.userId} or b.staff_id=#{record.userId})
 			</if>
-			<if test="record.vipStatus != null and record.vipStatus != '' and record.vipStatus!=0 ">
-				<if test="record.vipStatus == 1">
-					and a.state = '待确认'
-				</if>
-				<if test="record.vipStatus == 2">
-					and a.state in ( '预约成功待处理' ,'需配料','配料完成','服务中')
-				</if>
-				<if test="record.vipStatus == 3">
-					and ( a.state in ( '服务完成' ,'服务单结束') and a.comment is  null)
-				</if>
-				<if test="record.vipStatus == 4">
-					and a.comment is not null
-				</if>
-				<if test="record.vipStatus == 5">
-					and a.state = '预约取消'
-				</if>
-			</if>
+
 		</where>
 		<if test="pageVo !=null"><!-- 判断pageVo对象是否为空 -->
 			order by a.yy_time desc
@@ -567,4 +567,104 @@
 			</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