| | |
| | | tm.user_tags userTags, |
| | | tm.goods_type goodsType |
| | | FROM t_member tm |
| | | INNER JOIN t_member_total tmt ON tm.member_id = tmt.member_id |
| | | WHERE tm.relation_shop_id = #{param.shopId} |
| | | <if test="param.memberGender != null and param.memberGender != ''"> |
| | | AND tm.gender = #{param.memberGender} |
| | | </if> |
| | | <if test="param.memberType != null and param.memberType != ''"> |
| | | AND FIND_IN_SET(#{param.memberType},tm.goods_type) > 0 |
| | | </if> |
| | | <if test="param.memberTag != null and param.memberTag != ''"> |
| | | AND FIND_IN_SET(#{param.memberTag},tm.user_tags) > 0 |
| | |
| | | </if> |
| | | <if test="param.endMemberDate!=null and param.endMemberDate!=''"> |
| | | AND tm.create_time <= #{param.endMemberDate} |
| | | </if> |
| | | <if test="param.memberFrom != null and param.memberFrom != ''"> |
| | | AND tm.customer_source = #{param.memberFrom} |
| | | </if> |
| | | <if test="param.taskStartDate!=null and param.taskStartDate!=''"> |
| | | AND tmt.next_task_time >= #{param.taskStartDate} |
| | | </if> |
| | | <if test="param.taskEndDate!=null and param.taskEndDate!=''"> |
| | | AND tmt.next_task_time <= #{param.taskEndDate} |
| | | </if> |
| | | <if test="param.surpNum != null and param.surpNum != ''"> |
| | | AND tmt.useable_service_count = #{param.surpNum} |
| | | </if> |
| | | <if test="param.memberNurse != null and param.memberNurse != ''"> |
| | | AND FIND_IN_SET(#{param.memberNurse},tm.member_nurse) > 0 |
| | | </if> |
| | | <if test="param.actStartDate!=null and param.actStartDate!=''"> |
| | | AND tmt.last_pay_time >= #{param.actStartDate} |
| | | </if> |
| | | <if test="param.actEndDate!=null and param.actEndDate!=''"> |
| | | AND tmt.last_pay_time <= #{param.actEndDate} |
| | | </if> |
| | | <if test="param.keyword != null and param.keyword != ''"> |
| | | AND (tm.real_name LIKE CONCAT('%',#{param.keyword},'%') OR tm.mobile LIKE CONCAT('%',#{param.keyword},'%') OR tm.referrer LIKE CONCAT('%',#{param.keyword},'%')) |
| | |
| | | </if> |
| | | </select> |
| | | |
| | | <select id="getTotalMemberTotalNurse" resultType="com.ruoyi.system.api.domain.vo.MgtMapTotalVo"> |
| | | <select id="getTotalMemberTotalNurse" resultType="com.ruoyi.system.api.domain.vo.MgtMapIntTotalVo"> |
| | | SELECT member_nurse mapKey, COUNT(*) mapValue |
| | | FROM ( |
| | | SELECT member_id, SUBSTRING_INDEX(SUBSTRING_INDEX(member_nurse, ',', numbers.n), ',', -1) member_nurse |
| | |
| | | GROUP BY member_nurse |
| | | </select> |
| | | |
| | | <select id="getTotalMemberTotalGoodsType" resultType="com.ruoyi.system.api.domain.vo.MgtMapTotalVo"> |
| | | <select id="getTotalMemberTotalGoodsType" resultType="com.ruoyi.system.api.domain.vo.MgtMapIntTotalVo"> |
| | | SELECT goods_type mapKey, COUNT(*) mapValue |
| | | FROM ( |
| | | SELECT member_id, SUBSTRING_INDEX(SUBSTRING_INDEX(goods_type, ',', numbers.n), ',', -1) goods_type |
| | |
| | | </if> |
| | | </select> |
| | | |
| | | <select id="getTotalMemberRankPay" resultType="com.ruoyi.system.api.domain.vo.MgtMapTotalVo"> |
| | | <select id="getTotalMemberRankPay" resultType="com.ruoyi.system.api.domain.vo.MgtMapIntTotalVo"> |
| | | SELECT |
| | | tm.nick_name mapKey, |
| | | tmt.total_pay_count mapValue |
| | |
| | | ORDER BY tmt.total_pay_count DESC LIMIT 15 |
| | | </select> |
| | | |
| | | <select id="getTotalMemberRankCustomerSource" resultType="com.ruoyi.system.api.domain.vo.MgtMapTotalVo"> |
| | | <select id="getTotalMemberRankCustomerSource" resultType="com.ruoyi.system.api.domain.vo.MgtMapIntTotalVo"> |
| | | SELECT |
| | | tm.customer_source mapKey, |
| | | COUNT(tm.user_id) mapValue |
| | |
| | | </if> |
| | | </select> |
| | | |
| | | <select id="getPlTotalMemberTotalNurse" resultType="com.ruoyi.system.api.domain.vo.MgtMapTotalVo"> |
| | | <select id="getPlTotalMemberTotalNurse" resultType="com.ruoyi.system.api.domain.vo.MgtMapIntTotalVo"> |
| | | SELECT member_nurse mapKey, COUNT(*) mapValue |
| | | FROM ( |
| | | SELECT member_id, SUBSTRING_INDEX(SUBSTRING_INDEX(member_nurse, ',', numbers.n), ',', -1) member_nurse |
| | |
| | | GROUP BY member_nurse |
| | | </select> |
| | | |
| | | <select id="getPlTotalMemberTotalGoodsType" resultType="com.ruoyi.system.api.domain.vo.MgtMapTotalVo"> |
| | | <select id="getPlTotalMemberTotalGoodsType" resultType="com.ruoyi.system.api.domain.vo.MgtMapIntTotalVo"> |
| | | SELECT goods_type mapKey, COUNT(*) mapValue |
| | | FROM ( |
| | | SELECT member_id, SUBSTRING_INDEX(SUBSTRING_INDEX(goods_type, ',', numbers.n), ',', -1) goods_type |
| | |
| | | </if> |
| | | </select> |
| | | |
| | | <select id="getPlTotalMemberRankPay" resultType="com.ruoyi.system.api.domain.vo.MgtMapTotalVo"> |
| | | <select id="getPlTotalMemberRankPay" resultType="com.ruoyi.system.api.domain.vo.MgtMapIntTotalVo"> |
| | | SELECT |
| | | tm.nick_name mapKey, |
| | | tmt.total_pay_count mapValue |
| | |
| | | ORDER BY tmt.total_pay_count DESC LIMIT 15 |
| | | </select> |
| | | |
| | | <select id="getPlTotalMemberRankCustomerSource" resultType="com.ruoyi.system.api.domain.vo.MgtMapTotalVo"> |
| | | <select id="getPlTotalMemberRankCustomerSource" resultType="com.ruoyi.system.api.domain.vo.MgtMapIntTotalVo"> |
| | | SELECT |
| | | tm.customer_source mapKey, |
| | | COUNT(tm.user_id) mapValue |
| | |
| | | ORDER BY COUNT(tm.user_id) DESC LIMIT 15 |
| | | </select> |
| | | |
| | | <select id="getPlTotalMemberRank" resultType="com.ruoyi.system.api.domain.vo.MgtMapTotalVo"> |
| | | <select id="getPlTotalMemberRank" resultType="com.ruoyi.system.api.domain.vo.MgtMapIntTotalVo"> |
| | | SELECT |
| | | tm.relation_shop_name mapKey, |
| | | COUNT(tm.user_id) mapValue |