Merge branches 'master' and 'xzj' of https://gitee.com/darlk/ShengTangManage into xzj
This commit is contained in:
		| @@ -14,7 +14,7 @@ | ||||
|         <result property="recipesId" column="recipes_id"/> | ||||
|         <result property="sendFlag" column="send_flag"/> | ||||
|         <result property="sendTime" column="send_time"/> | ||||
|         <result property="pauseDate"    column="pause_date"/> | ||||
|         <result property="pauseDate" column="pause_date"/> | ||||
|         <result property="createTime" column="create_time"/> | ||||
|         <result property="createBy" column="create_by"/> | ||||
|         <result property="updateTime" column="update_time"/> | ||||
| @@ -22,6 +22,9 @@ | ||||
|         <result property="delFlag" column="del_flag"/> | ||||
|         <result property="cusId" column="cus_id"/> | ||||
|         <result property="outId" column="out_id"/> | ||||
|         <result property="subscribed" column="subscribed"/> | ||||
|         <result property="subSend" column="sub_send"/> | ||||
|         <result property="smsSend" column="sms_send"/> | ||||
|         <!-- 非持久化字段 --> | ||||
|         <!--        <result property="customerId" column="cus_id"></result><!– 客户ID –>--> | ||||
|         <result property="customer" column="customer"/><!-- 客户姓名 --> | ||||
| @@ -37,7 +40,7 @@ | ||||
|  | ||||
|  | ||||
|     <sql id="selectSysRecipesPlanVo"> | ||||
|         select id, order_id, cus_id, out_id, start_date, end_date, start_num_day, end_num_day, recipes_id, send_flag, send_time, pause_date, create_time, create_by, update_time, update_by, del_flag, review_status from sys_recipes_plan | ||||
|         select id, order_id, cus_id, out_id, start_date, end_date, start_num_day, end_num_day, recipes_id, send_flag, send_time, pause_date, create_time, create_by, update_time, update_by, del_flag, review_status, sub_send, sms_send, subscribed from sys_recipes_plan | ||||
|     </sql> | ||||
|  | ||||
|     <select id="selectSysRecipesPlanList" parameterType="SysRecipesPlan" resultMap="SysRecipesPlanResult"> | ||||
| @@ -63,7 +66,7 @@ | ||||
|     </select> | ||||
|  | ||||
|     <!-- 根据用户ID查询是否存在该用户该订单之前的最后一条食谱 --> | ||||
|     <select id="getLastDayRecipesPlan"  resultMap="SysRecipesPlanResult"> | ||||
|     <select id="getLastDayRecipesPlan" resultMap="SysRecipesPlanResult"> | ||||
|         select srp.* | ||||
|         from sys_recipes_plan srp | ||||
|         left join sys_order so on so.order_id = srp.order_id and so.del_flag = 0 | ||||
| @@ -135,6 +138,9 @@ | ||||
|             <if test="updateBy != null">update_by = #{updateBy},</if> | ||||
|             <if test="delFlag != null">del_flag = #{delFlag},</if> | ||||
|             <if test="reviewStatus != null">review_status = #{reviewStatus},</if> | ||||
|             <if test="subscribed != null">subscribed = #{subscribed},</if> | ||||
|             <if test="subSend != null">sub_send = #{subSend},</if> | ||||
|             <if test="smsSend != null">sms_send = #{smsSend},</if> | ||||
|         </trim> | ||||
|         where id = #{id} and del_flag = 0 | ||||
|     </update> | ||||
| @@ -153,10 +159,12 @@ | ||||
|     <!-- 批量插入食谱计划 --> | ||||
|     <insert id="insertBatch"> | ||||
|         INSERT INTO sys_recipes_plan | ||||
|         (order_id, cus_id, out_id, start_date, end_date, start_num_day, end_num_day, send_flag, send_time, pause_date, recipes_id) | ||||
|         (order_id, cus_id, out_id, start_date, end_date, start_num_day, end_num_day, send_flag, send_time, pause_date, | ||||
|         recipes_id) | ||||
|         VALUES | ||||
|         <foreach collection="list" item="plan" separator=","> | ||||
|             (#{plan.orderId}, #{plan.cusId}, #{plan.outId}, #{plan.startDate}, #{plan.endDate}, #{plan.startNumDay}, #{plan.endNumDay}, | ||||
|             (#{plan.orderId}, #{plan.cusId}, #{plan.outId}, #{plan.startDate}, #{plan.endDate}, #{plan.startNumDay}, | ||||
|             #{plan.endNumDay}, | ||||
|             #{plan.sendFlag}, #{plan.sendTime}, #{plan.pauseDate}, #{plan.recipesId}) | ||||
|         </foreach> | ||||
|     </insert> | ||||
| @@ -177,8 +185,10 @@ | ||||
|         FROM sys_recipes_plan srp | ||||
|         LEFT JOIN sys_order sr ON sr.order_id = srp.order_id | ||||
|         LEFT JOIN sys_customer sc ON sc.id = srp.cus_id | ||||
|         LEFT JOIN sys_user su_nutritionist ON su_nutritionist.user_id = sr.nutritionist_id AND su_nutritionist.del_flag = 0 | ||||
|         LEFT JOIN sys_user su_nutritionist_assis ON su_nutritionist_assis.user_id = sr.nutri_assis_id AND su_nutritionist_assis.del_flag = 0 | ||||
|         LEFT JOIN sys_user su_nutritionist ON su_nutritionist.user_id = sr.nutritionist_id AND su_nutritionist.del_flag | ||||
|         = 0 | ||||
|         LEFT JOIN sys_user su_nutritionist_assis ON su_nutritionist_assis.user_id = sr.nutri_assis_id AND | ||||
|         su_nutritionist_assis.del_flag = 0 | ||||
|         WHERE srp.del_flag = 0 AND sr.del_flag = 0 AND srp.type = 0 | ||||
|         <if test="orderId != null">AND srp.order_id = #{orderId}</if> | ||||
|         <if test="sendFlag != null">AND srp.send_flag = #{sendFlag}</if> | ||||
| @@ -238,16 +248,21 @@ | ||||
|         <result property="startNumDay" column="start_num_day"/> | ||||
|         <result property="endNumDay" column="end_num_day"/> | ||||
|         <result property="recipesId" column="recipes_id"/> | ||||
|         <result property="sendFlag" column="send_flag"/> | ||||
|         <result property="subscribed" column="subscribed"/> | ||||
|         <association property="menus" column="recipes_id" select="selectMenuIds"/> | ||||
|     </resultMap> | ||||
|  | ||||
|     <!--  通过outId查询食谱计划简要--> | ||||
|     <!--  通过outId查询食谱计划简要 | ||||
|               and review_status = 2 and send_flag = 1 | ||||
|     --> | ||||
|     <select id="selectRecipesPlanListInfo" resultMap="SysRecipesPlanListInfoResult"> | ||||
|         select id, start_date, end_date, start_num_day, end_num_day, recipes_id from sys_recipes_plan where out_id=#{outId} and del_flag = 0 and review_status = 2 and send_flag = 1 | ||||
|         select id, start_date, end_date, start_num_day, end_num_day, recipes_id, send_flag, subscribed from sys_recipes_plan where out_id=#{outId} and del_flag = 0 | ||||
|     </select> | ||||
|  | ||||
|     <!--    and review_status = 2 and send_flag = 1--> | ||||
|     <select id="selectRecipesPlanListInfoByCusId" resultMap="SysRecipesPlanListInfoResult"> | ||||
|         select id, start_date, end_date, start_num_day, end_num_day, recipes_id from sys_recipes_plan where cus_id=#{cusId} and del_flag = 0 and review_status = 2 and send_flag = 1 | ||||
|         select id, start_date, end_date, start_num_day, end_num_day, recipes_id, send_flag, subscribed from sys_recipes_plan where cus_id=#{cusId} and del_flag = 0 | ||||
|     </select> | ||||
|  | ||||
|     <resultMap type="SysRecipesDaily" id="SysRecipesResult"> | ||||
| @@ -265,6 +280,7 @@ | ||||
|         <!--<foreach collection="list" item="item" separator=";" open="" close=""> | ||||
|  | ||||
|         </foreach>--> | ||||
|         update sys_recipes_plan set start_date = #{startDate},end_date = #{endDate},pause_date=#{pauseDate} where id = #{id} | ||||
|         update sys_recipes_plan set start_date = #{startDate},end_date = #{endDate},pause_date=#{pauseDate} where id = | ||||
|         #{id} | ||||
|     </update> | ||||
| </mapper> | ||||
| @@ -0,0 +1,55 @@ | ||||
| <?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.stdiet.custom.mapper.SysWxSubscribePostLogMapper"> | ||||
|     <resultMap type="WxSubscribePostLog" id="WxSubscribePostLogResult"> | ||||
|         <result property="id" column="id"/> | ||||
|         <result property="appid" column="appid"/> | ||||
|         <result property="openid" column="openid"/> | ||||
|         <result property="sendTime" column="send_time"/> | ||||
|         <result property="planId" column="plan_id"/> | ||||
|         <result property="phone" column="phone"/> | ||||
|         <result property="result" column="result" typeHandler="com.stdiet.custom.typehandler.ObjectJsonHandler"/> | ||||
|         <result property="data" column="data" typeHandler="com.stdiet.custom.typehandler.ObjectJsonHandler"/> | ||||
|     </resultMap> | ||||
|  | ||||
|     <insert id="insertWxSubscribePostLog" parameterType="WxSubscribePostLog" useGeneratedKeys="true" keyProperty="id"> | ||||
|         insert into sys_wx_subscribe_post_log | ||||
|         <trim prefix="(" suffix=")" suffixOverrides=","> | ||||
|             <if test="appid != null">appid,</if> | ||||
|             <if test="openid != null">openid,</if> | ||||
|             <if test="planId != null">plan_id,</if> | ||||
|             <if test="sendTime != null">send_time,</if> | ||||
|             <if test="result != null">result,</if> | ||||
|             <if test="phone != null">phone,</if> | ||||
|             <if test="data != null">data,</if> | ||||
|             <if test="type != null">type,</if> | ||||
|         </trim> | ||||
|         <trim prefix="values (" suffix=")" suffixOverrides=","> | ||||
|             <if test="appid != null">#{appid},</if> | ||||
|             <if test="openid != null">#{openid},</if> | ||||
|             <if test="planId != null">#{planId},</if> | ||||
|             <if test="sendTime != null">#{sendTime},</if> | ||||
|             <if test="result != null">#{result, jdbcType=OTHER, typeHandler=com.stdiet.custom.typehandler.ObjectJsonHandler},</if> | ||||
|             <if test="phone != null">#{phone},</if> | ||||
|             <if test="data != null">#{data, jdbcType=OTHER, typeHandler=com.stdiet.custom.typehandler.ObjectJsonHandler},</if> | ||||
|             <if test="type != null">#{type},</if> | ||||
|         </trim> | ||||
|  | ||||
|     </insert> | ||||
|  | ||||
|     <select id="selectWxSubscribePostLog" parameterType="WxSubscribePostLog" resultMap="WxSubscribePostLogResult"> | ||||
|         select * from sys_wx_subscribe_post_log | ||||
|         <where> | ||||
|             <if test="id != null">AND id = #{id}</if> | ||||
|             <if test="openid != null">AND openid = #{openid}</if> | ||||
|             <if test="appid != null">AND appid = #{appid}</if> | ||||
|             <if test="planId != null">AND plan_id = #{planId}</if> | ||||
|             <if test="phone != null">AND phone = #{phone}</if> | ||||
|             <if test="type != null">AND type = #{type}</if> | ||||
|         </where> | ||||
|     </select> | ||||
|  | ||||
| </mapper> | ||||
| @@ -32,6 +32,7 @@ | ||||
|         <where> | ||||
|             <if test="nickName != null  and nickName != ''">and nick_name like concat('%', #{nickName}, '%')</if> | ||||
|             <if test="appid != null  and appid != ''">and appid = #{appid}</if> | ||||
|             <if test="cusId != null  and cusId != ''">and cus_id = #{cusId}</if> | ||||
|             <if test="phone != null  and phone != ''">and phone = #{phone}</if> | ||||
|             <if test="sex != null  and sex != ''">and sex = #{sex}</if> | ||||
|         </where> | ||||
| @@ -45,6 +46,11 @@ | ||||
|         order by wxuser.update_time desc | ||||
|     </select> | ||||
|  | ||||
|     <select id="selectSysWxUserInfoByCusId" parameterType="Long" resultMap="SysWxUserInfoResult"> | ||||
|         <include refid="selectSysWxUserInfoVo"/> | ||||
|         where cus_id = #{cusId} | ||||
|     </select> | ||||
|  | ||||
|     <select id="selectSysWxUserInfoById" parameterType="String" resultMap="SysWxUserInfoResult"> | ||||
|         <include refid="selectSysWxUserInfoVo"/> | ||||
|         where openid = #{openid} | ||||
|   | ||||
		Reference in New Issue
	
	Block a user