Merge branch 'master' of gitee.com:darlk/ShengTangManage into develop
This commit is contained in:
@ -26,6 +26,7 @@
|
||||
<include refid="selectSysAskNutritionQuestionVo"/>
|
||||
from sys_ask_nutrition_question where del_flag = 0
|
||||
<if test="question != null and question != ''"> and question like concat('%',#{question},'%')</if>
|
||||
order by id desc
|
||||
</select>
|
||||
|
||||
<select id="selectSysAskNutritionQuestionById" parameterType="Long" resultMap="SysAskNutritionQuestionResult">
|
||||
@ -77,15 +78,15 @@
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteSysAskNutritionQuestionById" parameterType="Long">
|
||||
<update id="deleteSysAskNutritionQuestionById" parameterType="Long">
|
||||
update sys_ask_nutrition_question set del_flag = 1 where id = #{id}
|
||||
</delete>
|
||||
</update>
|
||||
|
||||
<delete id="deleteSysAskNutritionQuestionByIds" parameterType="String">
|
||||
<update id="deleteSysAskNutritionQuestionByIds" parameterType="String">
|
||||
update sys_ask_nutrition_question set del_flag = 1 where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</update>
|
||||
|
||||
</mapper>
|
@ -34,26 +34,41 @@
|
||||
</sql>
|
||||
|
||||
<select id="selectSysCustomerList" parameterType="SysCustomer" resultMap="SysCustomerResult">
|
||||
<include refid="selectSysCustomerVo"/>
|
||||
where del_flag = 0
|
||||
<if test="name != null and name != ''"> and (name like concat('%', #{name}, '%') or phone like concat('%', #{name}, '%'))</if>
|
||||
<if test="mainDietitian != null and mainDietitian != ''"> and main_dietitian = #{mainDietitian}</if>
|
||||
<if test="mainDietitian == 0"> and (isnull(main_dietitian) or main_dietitian=0)</if>
|
||||
<if test="salesman != null and salesman != ''"> and salesman = #{salesman}</if>
|
||||
<if test="salesman == 0"> and (isnull(salesman) or salesman=0)</if>
|
||||
<if test="afterDietitian != null and afterDietitian != ''"> and after_dietitian = #{afterDietitian}</if>
|
||||
<if test="afterDietitian == 0"> and (isnull(after_dietitian) or after_dietitian=0)</if>
|
||||
<if test="assistantDietitian != null and assistantDietitian != ''"> and assistant_dietitian = #{assistantDietitian}</if>
|
||||
<if test="assistantDietitian == 0"> and (isnull(assistant_dietitian) or assistant_dietitian=0)</if>
|
||||
<if test="fansChannel != null "> and fans_channel = #{fansChannel}</if>
|
||||
<if test="channelId != null "> and channel_id = #{channelId}</if>
|
||||
select
|
||||
sc.id, sc.name, sc.phone, sc.email, sc.fans_time, sc.fans_channel, sc.address, sc.pay_date, sc.start_date, sc.purchase_num, sc.pay_total, sc.main_dietitian,
|
||||
sc.assistant_dietitian, sc.after_dietitian, sc.salesman, sc.charge_person, sc.follow_status, sc.create_time,sc.channel_id
|
||||
from sys_customer sc
|
||||
left join sys_customer_healthy as sch
|
||||
on sch.customer_id = sc.id and sch.del_flag = 0
|
||||
where sc.del_flag = 0
|
||||
<if test="name != null and name != ''">
|
||||
and (sc.name like concat('%', #{name}, '%') or sc.phone like concat('%', #{name}, '%'))
|
||||
</if>
|
||||
<if test="mainDietitian != null and mainDietitian != ''"> and sc.main_dietitian = #{mainDietitian}</if>
|
||||
<if test="mainDietitian == 0"> and (isnull(sc.main_dietitian) or sc.main_dietitian=0)</if>
|
||||
<if test="salesman != null and salesman != ''"> and sc.salesman = #{salesman}</if>
|
||||
<if test="salesman == 0"> and (isnull(sc.salesman) or sc.salesman=0)</if>
|
||||
<if test="afterDietitian != null and afterDietitian != ''"> and sc.after_dietitian = #{afterDietitian}</if>
|
||||
<if test="afterDietitian == 0"> and (isnull(sc.after_dietitian) or sc.after_dietitian=0)</if>
|
||||
<if test="assistantDietitian != null and assistantDietitian != ''"> and sc.assistant_dietitian = #{assistantDietitian}</if>
|
||||
<if test="assistantDietitian == 0"> and (isnull(sc.assistant_dietitian) or sc.assistant_dietitian=0)</if>
|
||||
<if test="fansChannel != null "> and sc.fans_channel = #{fansChannel}</if>
|
||||
<if test="channelId != null "> and sc.channel_id = #{channelId}</if>
|
||||
<if test="channels != null">
|
||||
and channel_id in
|
||||
and sc.channel_id in
|
||||
<foreach collection="channels" item="cn" separator="," open="(" close=")">
|
||||
#{cn}
|
||||
</foreach>
|
||||
</if>
|
||||
order by create_time desc
|
||||
<if test="signIdList != null">
|
||||
and (
|
||||
sch.other_physical_signs like concat('%', #{name}, '%')
|
||||
<foreach collection="signIdList " item="signId" index="index" open=" OR (" close=")" separator=" OR ">
|
||||
FIND_IN_SET(#{signId}, sch.physical_signs_id)
|
||||
</foreach>
|
||||
)
|
||||
</if>
|
||||
order by sc.create_time desc
|
||||
</select>
|
||||
|
||||
<select id="selectSysCustomerById" parameterType="Long" resultMap="SysCustomerResult">
|
||||
@ -156,6 +171,12 @@
|
||||
where phone = #{phone} and del_flag = 0
|
||||
</select>
|
||||
|
||||
<!-- 根据openId查询客户 -->
|
||||
<select id="getCustomerByOpenId" parameterType="String" resultMap="SysCustomerResult">
|
||||
select sc.id from sys_customer sc
|
||||
left join sys_wx_user_info wu on wu.phone = sc.phone
|
||||
where wu.openid = #{openid} and sc.del_flag = 0 order by sc.id desc limit 1
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
@ -0,0 +1,144 @@
|
||||
<?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.SysMessageNoticeMapper">
|
||||
|
||||
<resultMap type="SysMessageNotice" id="SysMessageNoticeResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="messageProperty" column="message_property" />
|
||||
<result property="messageCustomer" column="message_customer" />
|
||||
<result property="messageType" column="message_type" />
|
||||
<result property="messageTitle" column="message_title" />
|
||||
<result property="messageContent" column="message_content" />
|
||||
<result property="readType" column="read_type" />
|
||||
<result property="messageKey" column="message_key" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
</resultMap>
|
||||
|
||||
<resultMap type="com.stdiet.custom.dto.response.MessageNoticeResponse" id="SysMessageNoticeResponse">
|
||||
<result property="id" column="id" />
|
||||
<result property="messageProperty" column="message_property" />
|
||||
<result property="messageCustomer" column="message_customer" />
|
||||
<result property="messageType" column="message_type" />
|
||||
<result property="messageTitle" column="message_title" />
|
||||
<result property="messageContent" column="message_content" />
|
||||
<result property="readType" column="read_type" />
|
||||
<result property="messageKey" column="message_key" />
|
||||
<result property="createTime" column="create_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectSysMessageNoticeVo">
|
||||
id, message_property, message_customer, message_type, message_title, message_content, read_type, message_key, create_time, create_by, update_time, update_by, del_flag
|
||||
</sql>
|
||||
|
||||
<select id="selectSysMessageNoticeList" parameterType="SysMessageNotice" resultMap="SysMessageNoticeResult">
|
||||
select
|
||||
<include refid="selectSysMessageNoticeVo"/>
|
||||
from sys_message_notice
|
||||
where del_flag = 0
|
||||
</select>
|
||||
|
||||
<select id="selectSysMessageNoticeById" parameterType="Long" resultMap="SysMessageNoticeResult">
|
||||
select
|
||||
<include refid="selectSysMessageNoticeVo"/>
|
||||
from sys_message_notice
|
||||
where id = #{id} and del_flag = 0 order by id desc
|
||||
</select>
|
||||
|
||||
<insert id="insertSysMessageNotice" parameterType="SysMessageNotice">
|
||||
insert into sys_message_notice
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">id,</if>
|
||||
<if test="messageProperty != null">message_property,</if>
|
||||
<if test="messageCustomer != null">message_customer,</if>
|
||||
<if test="messageType != null">message_type,</if>
|
||||
<if test="messageTitle != null">message_title,</if>
|
||||
<if test="messageContent != null">message_content,</if>
|
||||
<if test="readType != null">read_type,</if>
|
||||
<if test="messageKey != null">message_key,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="delFlag != null">del_flag,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">#{id},</if>
|
||||
<if test="messageProperty != null">#{messageProperty},</if>
|
||||
<if test="messageCustomer != null">#{messageCustomer},</if>
|
||||
<if test="messageType != null">#{messageType},</if>
|
||||
<if test="messageTitle != null">#{messageTitle},</if>
|
||||
<if test="messageContent != null">#{messageContent},</if>
|
||||
<if test="readType != null">#{readType},</if>
|
||||
<if test="messageKey != null">#{messageKey},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="delFlag != null">#{delFlag},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateSysMessageNotice" parameterType="SysMessageNotice">
|
||||
update sys_message_notice
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="messageProperty != null">message_property = #{messageProperty},</if>
|
||||
<if test="messageCustomer != null">message_customer = #{messageCustomer},</if>
|
||||
<if test="messageType != null">message_type = #{messageType},</if>
|
||||
<if test="messageTitle != null">message_title = #{messageTitle},</if>
|
||||
<if test="messageContent != null">message_content = #{messageContent},</if>
|
||||
<if test="readType != null">read_type = #{readType},</if>
|
||||
<if test="messageKey != null">message_key = #{messageKey},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<update id="deleteSysMessageNoticeById" parameterType="Long">
|
||||
update sys_message_notice set del_flag = 1 where id = #{id}
|
||||
</update>
|
||||
|
||||
<update id="deleteSysMessageNoticeByIds" parameterType="String">
|
||||
update sys_message_notice set del_flag = 1 where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
<!-- 根据客户ID获取用户的消息 -->
|
||||
<select id="getCustomerMessage" parameterType="SysMessageNotice" resultMap="SysMessageNoticeResponse">
|
||||
select
|
||||
smn.id, smn.message_property, smn.message_customer, smn.message_type, smn.message_title, smn.message_content, smn.read_type, smn.message_key, smn.create_time
|
||||
from sys_message_notice smn
|
||||
where smn.del_flag = 0 and (smn.message_property = 0 or smn.message_customer = #{messageCustomer})
|
||||
<if test="readType != null">
|
||||
and smn.read_type = #{readType}
|
||||
</if>
|
||||
<if test="messageType != null">
|
||||
and smn.message_type = #{messageType}
|
||||
</if>
|
||||
order by smn.id desc
|
||||
</select>
|
||||
|
||||
<!-- 根据客户ID获取用户的消息数量 -->
|
||||
<select id="getCustomerMessageCount" parameterType="SysMessageNotice" resultType="int">
|
||||
select count(smn.id)
|
||||
from sys_message_notice smn
|
||||
where smn.del_flag = 0 and (smn.message_property = 0 or smn.message_customer = #{messageCustomer})
|
||||
<if test="readType != null">
|
||||
and smn.read_type = #{readType}
|
||||
</if>
|
||||
<if test="messageType != null">
|
||||
and smn.message_type = #{messageType}
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
@ -0,0 +1,109 @@
|
||||
<?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.SysNutritionalVideoMapper">
|
||||
|
||||
<resultMap type="SysNutritionalVideo" id="SysNutritionalVideoResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="cateId" column="cate_id" />
|
||||
<result property="videoId" column="video_id" />
|
||||
<result property="coverUrl" column="cover_url" />
|
||||
<result property="title" column="title" />
|
||||
<result property="description" column="description" />
|
||||
<result property="videoSize" column="video_size" />
|
||||
<result property="tags" column="tags" />
|
||||
<result property="showFlag" column="show_flag" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectSysNutritionalVideoVo">
|
||||
select id, cate_id, video_id, cover_url, title, description, 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">
|
||||
<include refid="selectSysNutritionalVideoVo"/> where del_flag = 0
|
||||
<if test="showFlag != null">
|
||||
and show_flag = #{showFlag}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="selectSysNutritionalVideoById" parameterType="Long" resultMap="SysNutritionalVideoResult">
|
||||
<include refid="selectSysNutritionalVideoVo"/>
|
||||
where id = #{id} and del_flag = 0
|
||||
</select>
|
||||
|
||||
<insert id="insertSysNutritionalVideo" parameterType="SysNutritionalVideo" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into sys_nutritional_video
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="cateId != null">cate_id,</if>
|
||||
<if test="videoId != null">video_id,</if>
|
||||
<if test="coverUrl != null">cover_url,</if>
|
||||
<if test="title != null">title,</if>
|
||||
<if test="description != null">description,</if>
|
||||
<if test="videoSize != null">video_size,</if>
|
||||
<if test="tags != null">tags,</if>
|
||||
<if test="showFlag != null">show_flag,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="delFlag != null">del_flag,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="cateId != null">#{cateId},</if>
|
||||
<if test="videoId != null">#{videoId},</if>
|
||||
<if test="coverUrl != null">#{coverUrl},</if>
|
||||
<if test="title != null">#{title},</if>
|
||||
<if test="description != null">#{description},</if>
|
||||
<if test="videoSize != null">#{videoSize},</if>
|
||||
<if test="tags != null">#{tags},</if>
|
||||
<if test="showFlag != null">#{showFlag},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="delFlag != null">#{delFlag},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateSysNutritionalVideo" parameterType="SysNutritionalVideo">
|
||||
update sys_nutritional_video
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="cateId != null">cate_id = #{cateId},</if>
|
||||
<if test="videoId != null">video_id = #{videoId},</if>
|
||||
<if test="coverUrl != null">cover_url = #{coverUrl},</if>
|
||||
<if test="title != null">title = #{title},</if>
|
||||
<if test="description != null">description = #{description},</if>
|
||||
<if test="videoSize != null">video_size = #{videoSize},</if>
|
||||
<if test="tags != null">tags = #{tags},</if>
|
||||
<if test="showFlag != null">show_flag = #{showFlag},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<update id="deleteSysNutritionalVideoById" parameterType="Long">
|
||||
update sys_nutritional_video set del_flag = 1 where id = #{id}
|
||||
</update>
|
||||
|
||||
<update id="deleteSysNutritionalVideoByIds" parameterType="String">
|
||||
update sys_nutritional_video set del_flag = 1 where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
<select id="selectSysNutritionalVideByVideoId" parameterType="String" resultMap="SysNutritionalVideoResult">
|
||||
<include refid="selectSysNutritionalVideoVo"/> where video_id = #{videoId} and del_flag = 0 limit 1
|
||||
</select>
|
||||
|
||||
</mapper>
|
@ -66,5 +66,10 @@
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<!-- 根据体征名称查询体征ID -->
|
||||
<select id="getSignIdByName" parameterType="String" resultType="Long">
|
||||
select sps.id from sys_physical_signs sps where sps.name like concat('%', #{name}, '%')
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
Reference in New Issue
Block a user