123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- <?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.caimei365.user.mapper.ClubMapper">
- <update id="updateClubUserByUpdateInfo">
- update user set
- <if test="name != null and name != ''">
- name = #{name},
- </if>
- <if test="email != null and email != ''">
- email = #{email},
- </if>
- userName = #{userName}
- where userID = #{userId}
- </update>
- <update id="updateClubByUpdateInfo">
- update club set
- <if test="name != null and name != ''">
- name = #{name},
- </if>
- <if test="shortName != null and shortName != ''">
- sname = #{shortName},
- </if>
- <if test="contractEmail != null and contractEmail != ''">
- contractEmail1 = #{contractEmail},
- </if>
- <if test="contractPhone != null and contractPhone != ''">
- contractPhone = #{contractPhone},
- </if>
- <if test="linkMan != null and linkMan != ''">
- linkMan = #{linkMan},
- </if>
- <if test="townId != null and townId != ''">
- provinceID = #{provinceId}, cityID = #{cityId}, townID = #{townId}, address = #{address},
- </if>
- <if test="shopPhoto != null and shopPhoto != 'null' and shopPhoto != ''">
- headpic = #{shopPhoto},
- </if>
- <if test="businessLicense != null and businessLicense != ''">
- businessLicenseImage = #{businessLicense},
- </if>
- <if test="socialCreditCode != null and socialCreditCode != ''">
- socialCreditCode = #{socialCreditCode},
- </if>
- <if test="firstClubType != null and firstClubType != ''">
- firstClubType = #{firstClubType},
- </if>
- <if test="firstClubType == 1">
- secondClubType = #{secondClubType}, department = #{department}, medicalPracticeLicenseImg = #{medicalPracticeLicense},
- </if>
- <if test="mainProduct != null and mainProduct != ''">
- mainpro = #{mainProduct},
- </if>
- <if test="fax != null and fax != ''">
- fax = #{fax},
- </if>
- <if test="profile != null and profile != ''">
- info = #{profile},
- </if>
- lastModify = NOW()
- where clubID = #{clubId}
- </update>
- <select id="getClubById" resultType="com.caimei365.user.model.vo.ClubVo">
- select clubID as clubId, userID as userId, name, sname as shortName, contractMobile, contractEmail1 as contractEmail,
- contractPhone, linkMan, provinceID as proviceId, cityID as cityId, townID as townId,
- address, headpic as shopPhoto, businessLicenseImage as businessLicense, socialCreditCode,
- firstClubType, secondClubType, department, medicalPracticeLicenseImg as medicalPracticeLicense,
- mainpro as mainProduct, fax, info as profile, spID as serviceProviderId, addTime, status
- from club
- where clubID = #{clubId}
- </select>
- <select id="getOrderCount" resultType="com.caimei365.user.model.vo.OrderCountVo">
- select userID as userId,
- (select COUNT(*) from cm_order where userID = #{userId} and delFlag = '0') as orderCount,
- (select COUNT(*) from cm_order where userID = #{userId} and delFlag = '0' and status = '0') as confirmedCount,
- (select COUNT(*) from cm_order where userID = #{userId} and delFlag = '0' and status in(11,12,13,21,22,23)) as paymentCount,
- (select COUNT(*) from cm_order where userID = #{userId} and delFlag = '0' and status in(11,12,21,22,31,32)) as waitShipmentsCount,
- (select COUNT(*) from cm_order where userID = #{userId} and delFlag = '0' and status in(12,13,22,23,32,33)) as shipmentsCount,
- (select COUNT(*) from cm_order where userID = #{userId} and delFlag = '0' and status in(1,2)) as salesReturnCount
- from cm_order
- where userID = #{userId} and delFlag = '0'
- limit 1
- </select>
- </mapper>
|