| | |
| | | <result property="disease" column="disease"/> |
| | | <result property="zjm" column="zjm"/> |
| | | <result property="companyId" column="company_id"/> |
| | | <result property="province" column="province"/> |
| | | <result property="city" column="city"/> |
| | | <result property="area" column="area"/> |
| | | <result property="recommendId" column="recommend_id"/> |
| | | |
| | | <result property="statu" column="statu"/> |
| | | <result property="birthdayType" column="birthdayType"/> |
| | |
| | | <!-- 扩展属性 --> |
| | | <result property="staffName" column="STAFF_NAME"/> |
| | | <result property="shopName" column="SHOP_NAME"/> |
| | | <association property="vipLevel" javaType="com.matrix.system.hive.bean.SysVipLevel" > |
| | | <result property="levelName" column="levelName"/> |
| | | <result property="vipLevel" column="vipLevel"/> |
| | | </association> |
| | | </resultMap> |
| | | |
| | | <!-- 查询几天内过生日的会员 --> |
| | |
| | | disease, |
| | | is_deal, |
| | | zjm, |
| | | company_id |
| | | company_id, |
| | | province, |
| | | city, |
| | | area, |
| | | recommend_id |
| | | ) |
| | | |
| | | |
| | |
| | | #{disease}, |
| | | #{isDeal}, |
| | | #{zjm}, |
| | | #{companyId} |
| | | #{companyId}, |
| | | #{province}, |
| | | #{city}, |
| | | #{area}, |
| | | #{recommendId} |
| | | ) |
| | | |
| | | </insert> |
| | |
| | | <if test="isDeal != null "> |
| | | is_deal = #{isDeal}, |
| | | </if> |
| | | <if test="recommendId != null "> |
| | | recommend_id = #{recommendId}, |
| | | </if> |
| | | <if test="province != null and province !='' "> |
| | | province = #{province}, |
| | | </if> |
| | | <if test="city != null and city !='' "> |
| | | city = #{city}, |
| | | </if> |
| | | <if test="area != null and area !='' "> |
| | | area = #{area}, |
| | | </if> |
| | | |
| | | |
| | | </set> |
| | |
| | | <include refid="from"></include> |
| | | where a.ID=#{id} |
| | | </select> |
| | | |
| | | |
| | | |
| | | <!-- 根据手机和密码查询 --> |
| | | <select id="selectVipByPhonePassWord" resultMap="SysVipInfoMap"> |
| | |
| | | COMMISSION_ALL,IN_DATE,STAFF_ID,SHOP_ID,IS_DELETE,REMARK,PASSWORD, |
| | | EMAIL,CREATE_TIME,UUID,BALANCE,blood,sfCard,link,marry,vocation |
| | | from sys_vip_info |
| | | where |
| | | SHOP_ID=#{shopId} |
| | | and ( |
| | | instr(PHONE,#{keyWord}) |
| | | where company_id=#{companyId} |
| | | and (instr(PHONE,#{keyWord}) |
| | | or instr(VIP_NAME ,#{keyWord}) |
| | | or instr(zjm ,#{keyWord}) |
| | | or instr(VIP_NO ,#{keyWord}) |
| | | ) |
| | | or instr(VIP_NO ,#{keyWord})) |
| | | limit 0,15 |
| | | </select> |
| | | |
| | |
| | | and |
| | | (a.VIP_NO =#{key} or |
| | | a.VIP_NAME =#{key} or |
| | | a.PHONE =#{key}) and a.shop_id=#{shopId} |
| | | a.PHONE =#{key}) |
| | | </select> |
| | | |
| | | <select id="getLevelIdByMoney" resultMap="SysVipInfoMap"> |
| | |
| | | a.create_distribution_time, |
| | | a.birthdayType, |
| | | a.disease, |
| | | a.is_deal |
| | | a.is_deal, |
| | | a.province, |
| | | a.city, |
| | | a.area, |
| | | a.recommend_id, |
| | | e.level_name levelName, |
| | | e.vip_level vipLevel |
| | | </sql> |
| | | <sql id="from"> |
| | | from sys_vip_info a |
| | | left join sys_users c on c.su_id =a.STAFF_ID |
| | | left join sys_shop_info d ON d.ID=a.SHOP_ID |
| | | left join sys_vip_level e on a.level_id=e.id |
| | | |
| | | </sql> |
| | | |
| | |
| | | a.PHONE phone, |
| | | a.photo photo, |
| | | b.arriveCnt arriveCnt, |
| | | g.shop_short_name shopName |
| | | g.shop_short_name shopName, |
| | | z.level_name vipLevel |
| | | from sys_vip_info a |
| | | left join ( |
| | | select x.vip_id, count(1) arriveCnt from ( |
| | |
| | | group by date_format(datatime, '%Y-%m-%d'), vip_id |
| | | ) x group by x.vip_id |
| | | ) b on a.ID=b.vip_id |
| | | left join sys_vip_level z on a.level_id=z.id |
| | | <!-- 本月消费 --> |
| | | <if test="record.sort == 'used'"> |
| | | left join ( |
| | |
| | | <if test="record.shopId != null"> |
| | | and a.shop_id=#{record.shopId} |
| | | </if> |
| | | <if test="record.companyId != null"> |
| | | and a.company_id=#{record.companyId} |
| | | </if> |
| | | <if test='record.birthType=="1"'> |
| | | and a.BIRTHDAY1 between curdate() and DATE_ADD(CURDATE(), INTERVAL 3 DAY) |
| | | </if> |
| | |
| | | <if test="record.sort != 'monthArrived' and record.sort != 'yearArrived'"> |
| | | order by ${record.sort} ${record.order} |
| | | </if> |
| | | <if test="record.offset >=0 and record.limit >0"> |
| | | limit #{record.offset},#{record.limit} |
| | | </if> |
| | | </select> |
| | | |
| | | <select id="selectVipInfoById" resultType="com.matrix.system.app.vo.VipInfoVo"> |