123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152 |
- <?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.SellerMapper">
- <select id="getLoginSellerByMobile" resultType="com.caimei365.user.model.vo.UserLoginVo">
- select u.userID as userId,
- u.clubID as clubId,
- u.shopID as shopId,
- u.userName as userName,u.name as name,
- u.mobile as mobile,
- u.bindMobile as bindMobile,
- u.email as email,
- u.guideFlag as guideFlag,
- u.userPermission as userPermission,
- u.userIdentity as userIdentity,
- u.password as password
- from user u
- where
- u.mobile = #{mobile}
- and u.userIdentity = 1
- and u.userPermission = 4
- and u.validFlag = 1
- </select>
- <update id="updateServiceProviderByUserId">
- update serviceprovider
- set openid = #{openId}, unionId = #{unionId}
- where userID = #{userId}
- </update>
- <select id="findClubTemporary" resultType="com.caimei365.user.model.vo.ClubTemporaryVo">
- SELECT
- `id`,
- `userId`,
- `name`,
- `shortName`,
- `bindMobile`,
- `contractEmail`,
- `linkMan`,
- `provinceId`,
- `cityId`,
- `townId`,
- `address`,
- `shopPhoto`,
- `businessLicense`,
- `socialCreditCode`,
- `firstClubType`,
- `secondClubType`,
- `department`,
- `medicalPracticeLicense`,
- `mainProduct`,
- `isAgreed`
- FROM
- club_temporary
- WHERE
- userId = #{userId}
- <if test="searchName != null and searchName != ''">
- AND (name LIKE CONCAT('%',#{searchName},'%') OR linkMan LIKE CONCAT('%',#{searchName},'%'))
- </if>
- ORDER BY
- id DESC
- </select>
- <update id="updateClubTemporary">
- UPDATE
- `club_temporary`
- SET
- `name` = #{name},
- `shortName` = #{shortName},
- `bindMobile` = #{bindMobile},
- `contractEmail` = #{contractEmail},
- `linkMan` = #{linkMan},
- `provinceId` = #{provinceId},
- `cityId` = #{cityId},
- `townId` = #{townId},
- `address` = #{address},
- `shopPhoto` = #{shopPhoto},
- `businessLicense` = #{businessLicense},
- `socialCreditCode` = #{socialCreditCode},
- `firstClubType` = #{firstClubType},
- `secondClubType` = #{secondClubType},
- `department` = #{department},
- `medicalPracticeLicense` = #{medicalPracticeLicense},
- `mainProduct` = #{mainProduct},
- `isAgreed` = #{isAgreed}
- WHERE `id` = #{id}
- </update>
- <delete id="deleteTemporaryClub">
- DELETE FROM `club_temporary` WHERE `id` = #{id}
- </delete>
- <select id="findOrderNum" resultType="integer">
- SELECT
- COUNT(*)
- FROM
- cm_order
- WHERE
- userID = #{userId}
- AND orderSubmitType IN (0, 1, 2)
- <if test="lastCheckOrderDate != null">
- AND orderTime > #{lastCheckOrderDate}
- </if>
- </select>
- <select id="findClubs" resultType="com.caimei365.user.model.vo.ClubVo">
- select c.clubID as clubId, c.userID as userId, c.name, c.sname as shortName, c.contractMobile, c.contractEmail1 as contractEmail,
- c.contractPhone, c.linkMan, c.provinceID as proviceId, c.cityID as cityId, c.townID as townId,
- c.address, c.headpic as shopPhoto, c.businessLicenseImage as businessLicense, c.socialCreditCode,
- c.firstClubType, c.secondClubType, c.department, c.medicalPracticeLicenseImg as medicalPracticeLicense,
- c.mainpro as mainProduct, c.fax, c.info as profile, c.spID as serviceProviderId, c.addTime, c.status,
- u.userIdentity
- from club c
- left join user u on c.userID = u.userID
- where c.spID = #{serviceProviderId}
- <if test="status != null and status != 66">
- AND c.status = #{status}
- </if>
- <if test="status == 66">
- AND c.status IN (1,90,92,93)
- </if>
- <if test="name != null and name != ''">
- AND (c.name LIKE CONCAT('%',#{name},'%') OR c.linkMan LIKE CONCAT('%',#{name},'%'))
- </if>
- <if test="userIdentity != null">
- AND u.userIdentity = #{userIdentity}
- </if>
- order by c.clubID desc
- </select>
- <select id="getAllClubList" resultType="com.caimei365.user.model.vo.ClubVo">
- SELECT c.clubID as clubId, c.userID as userId, c.name, c.sname as shortName, c.contractMobile, c.contractEmail1 as contractEmail,
- c.contractPhone, c.linkMan, c.provinceID as proviceId, c.cityID as cityId, c.townID as townId,
- c.address, c.headpic as shopPhoto, c.businessLicenseImage as businessLicense, c.socialCreditCode,
- c.firstClubType, c.secondClubType, c.department, c.medicalPracticeLicenseImg as medicalPracticeLicense,
- c.mainpro as mainProduct, c.fax, c.info as profile, c.spID as serviceProviderId, c.addTime, c.status,
- u.userIdentity
- FROM club c
- LEFT JOIN user u ON c.userID=u.userID
- WHERE u.userOrganizeID = 0 AND c.status = '90'
- <if test="searchWord != null and searchWord != ''">
- and (
- c.name LIKE CONCAT('%',#{searchWord},'%') or
- c.linkMan1 LIKE CONCAT('%',#{searchWord},'%') or
- c.contractMobile1 LIKE CONCAT('%',#{searchWord},'%')
- )
- </if>
- </select>
- <select id="getSellerByUserId" resultType="com.caimei365.user.model.po.ServiceProviderPo">
- select serviceProviderID AS serviceProviderId, status, userID AS userId, openid, unionId, name, contractMobile,
- linkMan1, duty1, contractMobile1, auditStatus, auditTime, auditNote, validFlag, addTime,
- mainServiceProviderID AS mainServiceProviderId
- from serviceprovider where userID = #{userId}
- </select>
- </mapper>
|