Merge branch 'master' of gitee.com:darlk/ShengTangManage into develop
This commit is contained in:
		| @@ -45,6 +45,7 @@ | ||||
|     <select id="selectSysCustomerCaseList" parameterType="SysCustomerCase" resultMap="SysCustomerCaseResult"> | ||||
|         select scc.id, scc.name, scc.keyword, scc.remark, scc.customer_id, scc.wx_show, scc.create_time,sc.name as customer_name from sys_customer_case scc | ||||
|         left join sys_customer sc on sc.id = scc.customer_id and sc.del_flag = 0 | ||||
|         left join sys_customer_healthy as sch on sch.customer_id = sc.id and sch.del_flag = 0 | ||||
|         where scc.del_flag = 0 | ||||
|         <include refid="searchKey"> | ||||
|             <property name="keywordArray" value="#{keywordArray}"/> | ||||
| @@ -52,6 +53,21 @@ | ||||
|         <if test="customerName != null and customerName != ''"> | ||||
|             and sc.name like concat('%', #{customerName}, '%') | ||||
|         </if> | ||||
|         <if test="keyword != null"> | ||||
|             and | ||||
|             ( | ||||
|               sc.name like concat('%', #{keyword}, '%') or | ||||
|               scc.keyword like concat('%', #{keyword}, '%') or scc.name like concat('%', #{keyword}, '%') | ||||
|               or scc.remark like concat('%', #{keyword}, '%') or sch.other_physical_signs like concat('%', #{keyword}, '%') | ||||
|               or sch.remark like concat('%', #{keyword}, '%') | ||||
|             <if test="signIdList != null"> | ||||
|                   <foreach collection="signIdList " item="signId" index="index" open=" OR (" close=")" separator=" OR "> | ||||
|                       FIND_IN_SET(#{signId}, sch.physical_signs_id) | ||||
|                   </foreach> | ||||
|               </if> | ||||
|             ) | ||||
|         </if> | ||||
|  | ||||
|         <if test="wxShow != null"> | ||||
|             and scc.wx_show = #{wxShow} | ||||
|         </if> | ||||
|   | ||||
| @@ -62,7 +62,7 @@ | ||||
|         </if> | ||||
|         <if test="signIdList != null"> | ||||
|             and ( | ||||
|             sch.other_physical_signs like concat('%', #{name}, '%') | ||||
|             sch.other_physical_signs like concat('%', #{physicalSignsId}, '%') | ||||
|             <foreach collection="signIdList " item="signId" index="index" open=" OR (" close=")" separator=" OR "> | ||||
|                 FIND_IN_SET(#{signId}, sch.physical_signs_id) | ||||
|             </foreach> | ||||
|   | ||||
| @@ -16,6 +16,7 @@ | ||||
|         <result property="showFlag"    column="show_flag"    /> | ||||
|         <result property="priorityLevel"    column="priority_level"    /> | ||||
|         <result property="payLevel"    column="pay_level"    /> | ||||
|         <result property="playNum"    column="play_num"    /> | ||||
|         <result property="createTime"    column="create_time"    /> | ||||
|         <result property="createBy"    column="create_by"    /> | ||||
|         <result property="updateTime"    column="update_time"    /> | ||||
| @@ -27,11 +28,11 @@ | ||||
|     </resultMap> | ||||
|  | ||||
|     <sql id="selectSysNutritionalVideoVo"> | ||||
|         select id, cate_id, video_id, cover_url, title, description, priority_level,pay_level,video_size, tags, show_flag, create_time, create_by, update_time, update_by, del_flag from sys_nutritional_video | ||||
|         select id, cate_id, video_id, cover_url, title, description, priority_level,pay_level,play_num,video_size, tags, show_flag, create_time, create_by, update_time, update_by, del_flag from sys_nutritional_video | ||||
|     </sql> | ||||
|  | ||||
|     <select id="selectSysNutritionalVideoList" parameterType="SysNutritionalVideo" resultMap="SysNutritionalVideoResult"> | ||||
|         select snv.id, snv.cate_id, snv.video_id, snv.cover_url, snv.title, snv.description, snv.priority_level,snv.pay_level,snv.video_size, snv.tags, snv.show_flag, snv.create_time, | ||||
|         select snv.id, snv.cate_id, snv.video_id, snv.cover_url, snv.title, snv.description, snv.priority_level,snv.pay_level,snv.play_num,snv.video_size, snv.tags, snv.show_flag, snv.create_time, | ||||
|         pay.dict_label as pay_level_name, svc.cate_name | ||||
|         from sys_nutritional_video snv | ||||
|         left join (SELECT dict_label, dict_value FROM sys_dict_data WHERE dict_type = 'video_pay_level') AS pay ON pay.dict_value = snv.pay_level | ||||
| @@ -46,10 +47,23 @@ | ||||
|         <if test="payLevel != null"> | ||||
|             and snv.pay_level = #{payLevel} | ||||
|         </if> | ||||
|         <if test="userType != null"> | ||||
|             <if test="userType == 0"> | ||||
|                 and pay_level = 0 | ||||
|             </if> | ||||
|             <if test="userType == 1"> | ||||
|                 and (pay_level = 0 or pay_level = 1) | ||||
|             </if> | ||||
|         </if> | ||||
|         <if test="key != null and key != ''"> | ||||
|             and (snv.title like concat('%',#{key},'%') or snv.description like concat('%',#{key},'%')) | ||||
|         </if> | ||||
|         order by snv.priority_level DESC,snv.create_time DESC | ||||
|         <if test="sortType == null or sortType == 1"> | ||||
|             order by snv.create_time DESC | ||||
|         </if> | ||||
|         <if test="sortType != null and sortType == 2"> | ||||
|             order by snv.priority_level DESC,snv.create_time DESC | ||||
|         </if> | ||||
|     </select> | ||||
|  | ||||
|     <select id="selectSysNutritionalVideoById" parameterType="Long" resultMap="SysNutritionalVideoResult"> | ||||
| @@ -69,6 +83,7 @@ | ||||
|             <if test="tags != null">tags,</if> | ||||
|             <if test="showFlag != null">show_flag,</if> | ||||
|             <if test="priorityLevel != null">priority_level,</if> | ||||
|             <if test="playNum != null">play_num,</if> | ||||
|             <if test="createTime != null">create_time,</if> | ||||
|             <if test="createBy != null">create_by,</if> | ||||
|             <if test="payLevel != null">pay_level,</if> | ||||
| @@ -86,6 +101,7 @@ | ||||
|             <if test="tags != null">#{tags},</if> | ||||
|             <if test="showFlag != null">#{showFlag},</if> | ||||
|             <if test="priorityLevel != null">#{priorityLevel},</if> | ||||
|             <if test="playNum != null">#{playNum},</if> | ||||
|             <if test="createTime != null">#{createTime},</if> | ||||
|             <if test="createBy != null">#{createBy},</if> | ||||
|             <if test="payLevel != null">#{payLevel},</if> | ||||
| @@ -107,6 +123,7 @@ | ||||
|             <if test="tags != null">tags = #{tags},</if> | ||||
|             <if test="showFlag != null">show_flag = #{showFlag},</if> | ||||
|             <if test="priorityLevel != null">priority_level = #{priorityLevel},</if> | ||||
|             <if test="playNum != null">play_num = #{playNum},</if> | ||||
|             <if test="createTime != null">create_time = #{createTime},</if> | ||||
|             <if test="createBy != null">create_by = #{createBy},</if> | ||||
|             <if test="payLevel != null">pay_level = #{payLevel},</if> | ||||
| @@ -139,4 +156,17 @@ | ||||
|         </foreach> | ||||
|     </update> | ||||
|  | ||||
|     <!-- 查询视频的阿里云ID,包含已删除的 --> | ||||
|     <select id="getVideoIdByIds" parameterType="String" resultType="String"> | ||||
|         select video_id from sys_nutritional_video where id in | ||||
|         <foreach item="id" collection="array" open="(" separator="," close=")"> | ||||
|             #{id} | ||||
|         </foreach> | ||||
|     </select> | ||||
|  | ||||
|     <!-- 更新视频播放量  --> | ||||
|     <update id="updateVideoPlayNum" parameterType="String"> | ||||
|         update sys_nutritional_video set play_num = play_num + 1 where video_id = #{videoId} and del_flag = 0 | ||||
|     </update> | ||||
|  | ||||
| </mapper> | ||||
| @@ -516,4 +516,15 @@ | ||||
|         select * from sys_order where del_flag = 0 and cus_id = #{cusId} order by order_time asc | ||||
|     </select> | ||||
|  | ||||
|     <!-- 根据微信openId查询客户订单数量 --> | ||||
|     <select id="getOrderCountByOpenId" parameterType="String" resultType="int"> | ||||
|       select count(so.order_id) from sys_order so | ||||
|       where so.del_flag = 0 and so.cus_id is not null and so.cus_id = (select su.cus_id from sys_wx_user_info su where su.openid = #{openid} limit 1) | ||||
|     </select> | ||||
|  | ||||
|     <!-- 根据营养师ID查询最后一单的情况 --> | ||||
|     <select id="getLastOrderByNutritionistId" parameterType="Long" resultMap="SysOrderResult"> | ||||
|         select * from sys_order so | ||||
|         where del_flag = 0 and nutritionist_id = #{nutritionistId} order by order_id desc limit 1 | ||||
|     </select> | ||||
| </mapper> | ||||
		Reference in New Issue
	
	Block a user