|  |  |  | 
|---|
|  |  |  | <result property="isDeal" column="is_deal"/> | 
|---|
|  |  |  | <result property="createDistributionTime" column="create_distribution_time"/> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <result property="isSales" column="is_sales" /> | 
|---|
|  |  |  | <result property="withdrawalCash" column="withdrawal_cash" /> | 
|---|
|  |  |  | <result property="salesmanGrade" column="salesman_grade" /> | 
|---|
|  |  |  | <result property="nickName" column="nick_name" /> | 
|---|
|  |  |  | <result property="avatarUrl" column="avatar_url" /> | 
|---|
|  |  |  | <result property="gender" column="gender" /> | 
|---|
|  |  |  | <result property="country" column="country" /> | 
|---|
|  |  |  | <result property="sessionKey" column="session_key" /> | 
|---|
|  |  |  | <result property="userIsAuthorize" column="user_is_authorize" /> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <!-- 扩展属性 --> | 
|---|
|  |  |  | <result property="staffName" column="STAFF_NAME"/> | 
|---|
|  |  |  | 
|---|
|  |  |  | <result property="createDistributionTime" column="create_distribution_time"/> | 
|---|
|  |  |  | <result property="disease" column="disease"/> | 
|---|
|  |  |  | <result property="companyId" column="company_id"/> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <result property="isSales" column="is_sales" /> | 
|---|
|  |  |  | <result property="withdrawalCash" column="withdrawal_cash" /> | 
|---|
|  |  |  | <result property="salesmanGrade" column="salesman_grade" /> | 
|---|
|  |  |  | <result property="nickName" column="nick_name" /> | 
|---|
|  |  |  | <result property="avatarUrl" column="avatar_url" /> | 
|---|
|  |  |  | <result property="gender" column="gender" /> | 
|---|
|  |  |  | <result property="country" column="country" /> | 
|---|
|  |  |  | <result property="sessionKey" column="session_key" /> | 
|---|
|  |  |  | <result property="userIsAuthorize" column="user_is_authorize" /> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <!-- 扩展属性 --> | 
|---|
|  |  |  | <result property="staffName" column="STAFF_NAME"/> | 
|---|
|  |  |  | <result property="shopName" column="SHOP_NAME"/> | 
|---|
|  |  |  | 
|---|
|  |  |  | province, | 
|---|
|  |  |  | city, | 
|---|
|  |  |  | area, | 
|---|
|  |  |  | recommend_id | 
|---|
|  |  |  | recommend_id, | 
|---|
|  |  |  | is_sales, | 
|---|
|  |  |  | withdrawal_cash, | 
|---|
|  |  |  | salesman_grade, | 
|---|
|  |  |  | nick_name, | 
|---|
|  |  |  | avatar_url, | 
|---|
|  |  |  | gender, | 
|---|
|  |  |  | country, | 
|---|
|  |  |  | session_key, | 
|---|
|  |  |  | user_is_authorize | 
|---|
|  |  |  | ) | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | #{province}, | 
|---|
|  |  |  | #{city}, | 
|---|
|  |  |  | #{area}, | 
|---|
|  |  |  | #{recommendId} | 
|---|
|  |  |  | #{recommendId}, | 
|---|
|  |  |  | #{isSales}, | 
|---|
|  |  |  | #{withdrawalCash}, | 
|---|
|  |  |  | #{salesmanGrade}, | 
|---|
|  |  |  | #{nickName}, | 
|---|
|  |  |  | #{avatarUrl}, | 
|---|
|  |  |  | #{gender}, | 
|---|
|  |  |  | #{country}, | 
|---|
|  |  |  | #{sessionKey}, | 
|---|
|  |  |  | #{userIsAuthorize} | 
|---|
|  |  |  | ) | 
|---|
|  |  |  |  | 
|---|
|  |  |  | </insert> | 
|---|
|  |  |  | 
|---|
|  |  |  | <if test="area != null and area !=''  "> | 
|---|
|  |  |  | area = #{area}, | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <if test="isSales != null "> | 
|---|
|  |  |  | is_sales  = #{isSales}, | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <if test="withdrawalCash != null "> | 
|---|
|  |  |  | withdrawal_cash  = #{withdrawalCash}, | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <if test="salesmanGrade != null "> | 
|---|
|  |  |  | salesman_grade  = #{salesmanGrade}, | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <if test="gender != null and gender != '' "> | 
|---|
|  |  |  | gender  = #{gender}, | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <if test="country != null and country != '' "> | 
|---|
|  |  |  | country  = #{country}, | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <if test="sessionKey != null and sessionKey != '' "> | 
|---|
|  |  |  | session_key  = #{sessionKey}, | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <if test="userIsAuthorize != null "> | 
|---|
|  |  |  | user_is_authorize  = #{userIsAuthorize}, | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <if test="nickName != null and nickName != '' "> | 
|---|
|  |  |  | nick_name  = #{nickName}, | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <if test="avatarUrl != null and avatarUrl != '' "> | 
|---|
|  |  |  | avatar_url  = #{avatarUrl}, | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | </set> | 
|---|
|  |  |  | 
|---|
|  |  |  | <update id="pointClose"> | 
|---|
|  |  |  | UPDATE sys_vip_info set POINT_ALL = 0 | 
|---|
|  |  |  | </update> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <update id="unbundlingSaleMan"> | 
|---|
|  |  |  | UPDATE sys_vip_info set recommend_id = NULL where id=#{userId}; | 
|---|
|  |  |  | </update> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <!-- 批量删除 --> | 
|---|
|  |  |  | <delete id="deleteByIds" parameterType="java.util.List"> | 
|---|
|  |  |  | 
|---|
|  |  |  | where a.ID=#{id} | 
|---|
|  |  |  | </select> | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <select id="findByOpenId" resultMap="SysVipInfoMap"> | 
|---|
|  |  |  | select * | 
|---|
|  |  |  | from sys_vip_info where openid=#{openId} | 
|---|
|  |  |  | </select> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <!-- 根据手机和密码查询 --> | 
|---|
|  |  |  | <select id="selectVipByPhonePassWord" resultMap="SysVipInfoMap"> | 
|---|
|  |  |  | 
|---|
|  |  |  | <if test="(record.companyId!=null and record.companyId!='') "> | 
|---|
|  |  |  | and a.company_id = #{record.companyId} | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <if test="(record.nickName!=null and record.nickName!='') or  (record.nickName!='' and record.nickName==0)  "> | 
|---|
|  |  |  | and a.nick_name  like concat('%',#{record.nickName},'%') | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <if test="(record.avatarUrl!=null and record.avatarUrl!='') or  (record.avatarUrl!='' and record.avatarUrl==0)  "> | 
|---|
|  |  |  | and a.avatar_url  = #{record.avatarUrl} | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <if test="record.isSales != null and record.isSales !='' "> | 
|---|
|  |  |  | and a.is_sales = #{record.isSales} | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <if test="record.withdrawalCash != null and record.withdrawalCash !='' "> | 
|---|
|  |  |  | and a.withdrawal_cash = #{record.withdrawalCash} | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <if test="record.salesmanGrade != null and record.salesmanGrade !='' "> | 
|---|
|  |  |  | and a.salesman_grade = #{record.salesmanGrade} | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <if test="(record.userIsAuthorize!=null and record.userIsAuthorize!='') or  (record.userIsAuthorize!='' and record.userIsAuthorize==0)  "> | 
|---|
|  |  |  | and a.user_is_authorize  = #{record.userIsAuthorize} | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | </sql> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | <if test="record.isDeal != null and record.isDeal !='' "> | 
|---|
|  |  |  | and a.is_deal = #{record.isDeal} | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <if test="(record.nickName!=null and record.nickName!='') or  (record.nickName!='' and record.nickName==0)  "> | 
|---|
|  |  |  | and a.nick_name  like concat('%',#{record.nickName},'%') | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <if test="(record.avatarUrl!=null and record.avatarUrl!='') or  (record.avatarUrl!='' and record.avatarUrl==0)  "> | 
|---|
|  |  |  | and a.avatar_url  = #{record.avatarUrl} | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <if test="record.isSales != null and record.isSales !='' "> | 
|---|
|  |  |  | and a.is_sales = #{record.isSales} | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <if test="record.withdrawalCash != null and record.withdrawalCash !='' "> | 
|---|
|  |  |  | and a.withdrawal_cash = #{record.withdrawalCash} | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <if test="record.salesmanGrade != null and record.salesmanGrade !='' "> | 
|---|
|  |  |  | and a.salesman_grade = #{record.salesmanGrade} | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <if test="(record.userIsAuthorize!=null and record.userIsAuthorize!='') or  (record.userIsAuthorize!='' and record.userIsAuthorize==0)  "> | 
|---|
|  |  |  | and a.user_is_authorize  = #{record.userIsAuthorize} | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | </sql> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <sql id="select"> | 
|---|
|  |  |  | select | 
|---|
|  |  |  | a.ID, | 
|---|
|  |  |  | a.VIP_NO, | 
|---|
|  |  |  | a.VIP_NAME, | 
|---|
|  |  |  | a.PHONE, | 
|---|
|  |  |  | a.SEX, | 
|---|
|  |  |  | a.BIRTHDAY1, | 
|---|
|  |  |  | a.photo, | 
|---|
|  |  |  | a.ADDR, | 
|---|
|  |  |  | a.CONSTELL, | 
|---|
|  |  |  | a.ANIMAL_SIGN, | 
|---|
|  |  |  | a.ARRIVAL_WAY, | 
|---|
|  |  |  | a.VIP_TYPE, | 
|---|
|  |  |  | a.VIP_STATE, | 
|---|
|  |  |  | a.POINT_ALL, | 
|---|
|  |  |  | a.COMMISSION_ALL, | 
|---|
|  |  |  | a.IN_DATE, | 
|---|
|  |  |  | a.REMARK, | 
|---|
|  |  |  | a.SHOP_ID, | 
|---|
|  |  |  | a.IS_DELETE, | 
|---|
|  |  |  | a.EMAIL, | 
|---|
|  |  |  | a.STAFF_ID, | 
|---|
|  |  |  | a.CREATE_TIME, | 
|---|
|  |  |  | a.LEVEL_ID, | 
|---|
|  |  |  | a.UUID, | 
|---|
|  |  |  | a.BALANCE, | 
|---|
|  |  |  | a.BEATUY_ID, | 
|---|
|  |  |  | a.PASSWORD, | 
|---|
|  |  |  | a.*, | 
|---|
|  |  |  | c.su_name as STAFF_NAME, | 
|---|
|  |  |  | d.SHOP_NAME, | 
|---|
|  |  |  | a.blood, | 
|---|
|  |  |  | a.company_id, | 
|---|
|  |  |  | a.sfCard, | 
|---|
|  |  |  | a.link, | 
|---|
|  |  |  | a.marry, | 
|---|
|  |  |  | a.vocation, | 
|---|
|  |  |  | a.handle_time, | 
|---|
|  |  |  | a.statu, | 
|---|
|  |  |  | a.openid, | 
|---|
|  |  |  | a.parent_id, | 
|---|
|  |  |  | a.create_distribution_time, | 
|---|
|  |  |  | a.birthdayType, | 
|---|
|  |  |  | a.disease, | 
|---|
|  |  |  | a.is_deal, | 
|---|
|  |  |  | a.province, | 
|---|
|  |  |  | a.city, | 
|---|
|  |  |  | a.area, | 
|---|
|  |  |  | a.recommend_id, | 
|---|
|  |  |  | e.level_name levelName, | 
|---|
|  |  |  | e.vip_level vipLevel | 
|---|
|  |  |  | </sql> | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <select id="selectByPhone" resultMap="SysVipInfoMapSimple"> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | select * from sys_vip_info where  PHONE = #{phone} | 
|---|
|  |  |  | select * from sys_vip_info where  PHONE = #{phone} and company_id=#{companyId} | 
|---|
|  |  |  | </select> | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | create_distribution_time, | 
|---|
|  |  |  | birthdayType, | 
|---|
|  |  |  | disease, | 
|---|
|  |  |  | is_deal | 
|---|
|  |  |  | is_deal, | 
|---|
|  |  |  | zjm, | 
|---|
|  |  |  | company_id, | 
|---|
|  |  |  | province, | 
|---|
|  |  |  | city, | 
|---|
|  |  |  | area, | 
|---|
|  |  |  | recommend_id, | 
|---|
|  |  |  | is_sales, | 
|---|
|  |  |  | withdrawal_cash, | 
|---|
|  |  |  | salesman_grade, | 
|---|
|  |  |  | nick_name, | 
|---|
|  |  |  | avatar_url, | 
|---|
|  |  |  | gender, | 
|---|
|  |  |  | country, | 
|---|
|  |  |  | session_key, | 
|---|
|  |  |  | user_is_authorize | 
|---|
|  |  |  | ) | 
|---|
|  |  |  | VALUES | 
|---|
|  |  |  | <foreach collection="list" item="item" index="index" separator=",">( | 
|---|
|  |  |  | 
|---|
|  |  |  | #{item.createDistributionTime}, | 
|---|
|  |  |  | #{item.birthdayType}, | 
|---|
|  |  |  | #{item.disease}, | 
|---|
|  |  |  | #{item.isDeal} | 
|---|
|  |  |  | #{item.isDeal}, | 
|---|
|  |  |  | #{zjm}, | 
|---|
|  |  |  | #{companyId}, | 
|---|
|  |  |  | #{province}, | 
|---|
|  |  |  | #{city}, | 
|---|
|  |  |  | #{area}, | 
|---|
|  |  |  | #{recommendId}, | 
|---|
|  |  |  | #{isSales}, | 
|---|
|  |  |  | #{withdrawalCash}, | 
|---|
|  |  |  | #{salesmanGrade}, | 
|---|
|  |  |  | #{nickName}, | 
|---|
|  |  |  | #{avatarUrl}, | 
|---|
|  |  |  | #{gender}, | 
|---|
|  |  |  | #{country}, | 
|---|
|  |  |  | #{sessionKey}, | 
|---|
|  |  |  | #{userIsAuthorize} | 
|---|
|  |  |  | )</foreach> | 
|---|
|  |  |  | </insert> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | left join sys_shop_info e on a.SHOP_ID=e.ID | 
|---|
|  |  |  | where a.ID=#{id} | 
|---|
|  |  |  | </select> | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | </mapper> | 
|---|
|  |  |  |  | 
|---|