|  |  |  | 
|---|
|  |  |  | <result property="companyId" column="company_id"/> | 
|---|
|  |  |  | <result property="comment" column="comment"/> | 
|---|
|  |  |  | <result property="reply" column="reply"/> | 
|---|
|  |  |  | <result property="overtimeNotice" column="overtime_notice"/> | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <result property="beautiName" column="beautiName"/> | 
|---|
|  |  |  | 
|---|
|  |  |  | <result property="shopName" column="shopName"/> | 
|---|
|  |  |  | <result property="createStaffName" column="createStaffName"/> | 
|---|
|  |  |  | <result property="bedName" column="bedName"/> | 
|---|
|  |  |  | <result property="vipName" column="VIP_Name"/> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <association property="vipInfo"  resultMap="com.matrix.system.hive.dao.SysVipInfoDao.SysVipInfoMapSimple" ></association> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | consume_time, | 
|---|
|  |  |  | company_id, | 
|---|
|  |  |  | comment, | 
|---|
|  |  |  | reply | 
|---|
|  |  |  | reply, | 
|---|
|  |  |  | overtime_notice | 
|---|
|  |  |  | ) | 
|---|
|  |  |  | VALUES ( | 
|---|
|  |  |  | #{id}, | 
|---|
|  |  |  | 
|---|
|  |  |  | #{consumeTime}, | 
|---|
|  |  |  | #{companyId}, | 
|---|
|  |  |  | #{comment}, | 
|---|
|  |  |  | #{reply} | 
|---|
|  |  |  | #{reply}, | 
|---|
|  |  |  | #{overtimeNotice} | 
|---|
|  |  |  | ) | 
|---|
|  |  |  |  | 
|---|
|  |  |  | </insert> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <!--  根据id更新 部分更新   --> | 
|---|
|  |  |  | <update id="updateOrderTime"> | 
|---|
|  |  |  | UPDATE sys_proj_services set CREATE_TIME=#{createTime} WHERE id=#{id} | 
|---|
|  |  |  | UPDATE sys_proj_services set consume_time=#{consumeTime} WHERE id=#{id} | 
|---|
|  |  |  | </update> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <!-- 设置服务单为已通知 --> | 
|---|
|  |  |  | <update id="updateNoticeTimes" > | 
|---|
|  |  |  | UPDATE sys_proj_services set overtime_notice=1 | 
|---|
|  |  |  | where  ID in | 
|---|
|  |  |  | <foreach collection="list" index="index" item="item" open="(" | 
|---|
|  |  |  | separator="," close=")"> | 
|---|
|  |  |  | #{item} | 
|---|
|  |  |  | </foreach> | 
|---|
|  |  |  | </update> | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <update id="update"> | 
|---|
|  |  |  | UPDATE sys_proj_services | 
|---|
|  |  |  | 
|---|
|  |  |  | CHANGE_ID = #{changeId}, | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <if test="oldShopId != null and oldShopId !='' "> | 
|---|
|  |  |  | OLD_SHOP_ID = #{oldShopId} | 
|---|
|  |  |  | OLD_SHOP_ID = #{oldShopId}, | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <if test="consumeTime != null  "> | 
|---|
|  |  |  | consume_time = #{consumeTime} | 
|---|
|  |  |  | consume_time = #{consumeTime}, | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <if test="reply != null  "> | 
|---|
|  |  |  | reply = #{reply} | 
|---|
|  |  |  | reply = #{reply}, | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <if test="comment != null  "> | 
|---|
|  |  |  | comment = #{comment} | 
|---|
|  |  |  | comment = #{comment}, | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <if test="overtimeNotice != null  "> | 
|---|
|  |  |  | overtime_notice = #{overtimeNotice}, | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | </set> | 
|---|
|  |  |  | WHERE id=#{id} | 
|---|
|  |  |  | </update> | 
|---|
|  |  |  | <update id="comment"> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | </update> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <!-- 批量删除 --> | 
|---|
|  |  |  | <delete id="deleteByIds" parameterType="java.util.List"> | 
|---|
|  |  |  | 
|---|
|  |  |  | left join sys_beautician_state c on a.id=c.SERVICES_ID | 
|---|
|  |  |  | where  a.ID=#{id} | 
|---|
|  |  |  | </select> | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <select id="selectNeedNoticeService" resultMap="SysProjServicesMap"> | 
|---|
|  |  |  | select | 
|---|
|  |  |  | a.id, | 
|---|
|  |  |  | a.company_id, | 
|---|
|  |  |  | b.VIP_Name | 
|---|
|  |  |  | FROM sys_proj_services a | 
|---|
|  |  |  | LEFT JOIN sys_vip_info b on b.ID=a.VIP_ID | 
|---|
|  |  |  | where   a.YY_TIME > now() | 
|---|
|  |  |  | and DATE_ADD(now(),INTERVAL 1 HOUR) > a.YY_TIME | 
|---|
|  |  |  | and overtime_notice is null | 
|---|
|  |  |  | </select> | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <!-- 根据对象查询--> | 
|---|
|  |  |  | <select id="selectByModel" resultMap="SysProjServicesMap"> | 
|---|
|  |  |  | select   distinct | 
|---|
|  |  |  | 
|---|
|  |  |  | 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> | 
|---|
|  |  |  | and a.company_id=#{record.companyId} | 
|---|
|  |  |  | <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> | 
|---|
|  |  |  | 
|---|
|  |  |  | 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> | 
|---|
|  |  |  | and a.company_id=#{record.companyId} | 
|---|
|  |  |  | <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> | 
|---|
|  |  |  | 
|---|
|  |  |  | </select> | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <select id="selectProjServicesByOrderItemId" resultMap="SysProjServicesMap"> | 
|---|
|  |  |  | select a.* from sys_proj_services a | 
|---|
|  |  |  | inner join sys_beautician_state b on a.id=b.SERVICES_ID | 
|---|
|  |  |  | inner join sys_proj_use c on c.id=b.puse_id | 
|---|
|  |  |  | where ORDER_ITEM_ID=#{itemId} and a.STATE!='预约取消' | 
|---|
|  |  |  | </select> | 
|---|
|  |  |  | </mapper> | 
|---|