| | |
| | | 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"> |
| | |
| | | <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"> |
| | |
| | | e.shop_short_name shopName, |
| | | sum(IFNULL(b.gift_money, 0) + IFNULL(b.real_money, 0)) totalBalance, |
| | | sum(IFNULL(b.gift_money, 0)) giftBalance, |
| | | sum(IFNULL(d.goods_cash, 0) + IFNULL(d.proj_cash, 0) + IFNULL(d.card_cash, 0)) totalShopping |
| | | (select sum(IFNULL(d.goods_cash, 0) + IFNULL(d.proj_cash, 0) + IFNULL(d.card_cash, 0)) from achieve_new d where d.vip_id=a.id) totalShopping |
| | | from sys_vip_info a |
| | | left join money_card_use b on a.ID = b.vip_id and b.status='有效' |
| | | left join sys_vip_level c on a.LEVEL_ID = c.ID |
| | | left join achieve_new d on a.ID = d.vip_id |
| | | left join sys_shop_info e on a.SHOP_ID=e.ID |
| | | where a.ID=#{id} |
| | | </select> |