|
@@ -2,85 +2,85 @@
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
<!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">
|
|
<mapper namespace="com.caimei365.user.mapper.SellerMapper">
|
|
<select id="getLoginSellerByMobile" resultType="com.caimei365.user.model.vo.UserLoginVo">
|
|
<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
|
|
|
|
|
|
+ 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
|
|
from user u
|
|
- where u.mobile = #{mobile}
|
|
|
|
|
|
+ where
|
|
|
|
+ u.mobile = #{mobile}
|
|
and u.userIdentity = 1
|
|
and u.userIdentity = 1
|
|
and u.userPermission = 4
|
|
and u.userPermission = 4
|
|
and u.validFlag = 1
|
|
and u.validFlag = 1
|
|
</select>
|
|
</select>
|
|
<update id="updateServiceProviderByUserId">
|
|
<update id="updateServiceProviderByUserId">
|
|
update serviceprovider
|
|
update serviceprovider
|
|
- set openid = #{openId},
|
|
|
|
- unionId = #{unionId}
|
|
|
|
|
|
+ set openid = #{openId}, unionId = #{unionId}
|
|
where userID = #{userId}
|
|
where userID = #{userId}
|
|
</update>
|
|
</update>
|
|
|
|
|
|
<select id="findClubTemporary" resultType="com.caimei365.user.model.vo.ClubTemporaryVo">
|
|
<select id="findClubTemporary" resultType="com.caimei365.user.model.vo.ClubTemporaryVo">
|
|
SELECT
|
|
SELECT
|
|
- `id`,
|
|
|
|
- `userId`,
|
|
|
|
- `name`,
|
|
|
|
- `shortName`,
|
|
|
|
- `bindMobile`,
|
|
|
|
- `contractEmail`,
|
|
|
|
- `linkMan`,
|
|
|
|
- `provinceId`,
|
|
|
|
- `cityId`,
|
|
|
|
- `townId`,
|
|
|
|
- `address`,
|
|
|
|
- `shopPhoto`,
|
|
|
|
- `businessLicense`,
|
|
|
|
- `socialCreditCode`,
|
|
|
|
- `firstClubType`,
|
|
|
|
- `secondClubType`,
|
|
|
|
- `department`,
|
|
|
|
- `medicalPracticeLicense`,
|
|
|
|
- `mainProduct`,
|
|
|
|
- `isAgreed`
|
|
|
|
|
|
+ `id`,
|
|
|
|
+ `userId`,
|
|
|
|
+ `name`,
|
|
|
|
+ `shortName`,
|
|
|
|
+ `bindMobile`,
|
|
|
|
+ `contractEmail`,
|
|
|
|
+ `linkMan`,
|
|
|
|
+ `provinceId`,
|
|
|
|
+ `cityId`,
|
|
|
|
+ `townId`,
|
|
|
|
+ `address`,
|
|
|
|
+ `shopPhoto`,
|
|
|
|
+ `businessLicense`,
|
|
|
|
+ `socialCreditCode`,
|
|
|
|
+ `firstClubType`,
|
|
|
|
+ `secondClubType`,
|
|
|
|
+ `department`,
|
|
|
|
+ `medicalPracticeLicense`,
|
|
|
|
+ `mainProduct`,
|
|
|
|
+ `isAgreed`
|
|
FROM
|
|
FROM
|
|
- club_temporary
|
|
|
|
|
|
+ club_temporary
|
|
WHERE
|
|
WHERE
|
|
- userId = #{userId}
|
|
|
|
- <if test="searchName != null and searchName != ''">
|
|
|
|
- AND (name LIKE CONCAT('%',#{searchName},'%') OR linkMan LIKE CONCAT('%',#{searchName},'%'))
|
|
|
|
- </if>
|
|
|
|
|
|
+ userId = #{userId}
|
|
|
|
+ <if test="searchName != null and searchName != ''">
|
|
|
|
+ AND (name LIKE CONCAT('%',#{searchName},'%') OR linkMan LIKE CONCAT('%',#{searchName},'%'))
|
|
|
|
+ </if>
|
|
ORDER BY
|
|
ORDER BY
|
|
- id DESC
|
|
|
|
|
|
+ id DESC
|
|
</select>
|
|
</select>
|
|
|
|
|
|
<update id="updateClubTemporary">
|
|
<update id="updateClubTemporary">
|
|
UPDATE
|
|
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}
|
|
|
|
|
|
+ `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}
|
|
WHERE `id` = #{id}
|
|
</update>
|
|
</update>
|
|
|
|
|
|
@@ -104,37 +104,19 @@
|
|
</select>
|
|
</select>
|
|
|
|
|
|
<select id="findClubs" resultType="com.caimei365.user.model.vo.ClubVo">
|
|
<select id="findClubs" resultType="com.caimei365.user.model.vo.ClubVo">
|
|
- select DISTINCT c.clubID as clubId, c.userID as userId, c.name, c.sname as shortName, c.contractMobile,
|
|
|
|
- c.contractEmail as contractEmail,
|
|
|
|
|
|
+ select DISTINCT c.clubID as clubId, c.userID as userId, c.name, c.sname as shortName, c.contractMobile, c.contractEmail as contractEmail,
|
|
c.contractPhone, c.linkMan, c.provinceID as proviceId, c.cityID as cityId, c.townID as townId,
|
|
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.address, c.headpic as shopPhoto, c.businessLicenseImage as businessLicense, c.socialCreditCode,
|
|
c.firstClubType, c.secondClubType, c.department, c.medicalPracticeLicenseImg as medicalPracticeLicense,
|
|
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,
|
|
|
|
- c.lastCheckOrderDate,
|
|
|
|
- u.userIdentity,c.newDeal as newDeal,IF(r.id IS NOT NULL,1,0) AS recordCount
|
|
|
|
- <if test="2 == type">
|
|
|
|
- ,s.linkMan as serviceName
|
|
|
|
- </if>
|
|
|
|
|
|
+ c.mainpro as mainProduct, c.fax, c.info as profile, c.spID as serviceProviderId, c.addTime, c.status, c.lastCheckOrderDate,
|
|
|
|
+ u.userIdentity,c.newDeal as newDeal,IF(r.id IS NOT NULL,1,0) AS recordCount,
|
|
|
|
+ covs.activeState AS activeState,
|
|
|
|
+ covs.customerValue AS customerValue
|
|
from club c
|
|
from club c
|
|
left join user u on c.userID = u.userID
|
|
left join user u on c.userID = u.userID
|
|
LEFT JOIN record_link r ON r.`clubId`=c.`clubID`
|
|
LEFT JOIN record_link r ON r.`clubId`=c.`clubID`
|
|
- <if test="2 == type">
|
|
|
|
- left join serviceprovider s on s.serviceProviderID=c.spID
|
|
|
|
- </if>
|
|
|
|
- where
|
|
|
|
- <if test="1 == type">
|
|
|
|
- c.spID = #{serviceProviderId}
|
|
|
|
- </if>
|
|
|
|
- <if test="2 == type">
|
|
|
|
- c.spID in
|
|
|
|
- <foreach collection="serviceIds" item="id" index="index" open="(" separator="," close=")">
|
|
|
|
- #{id}
|
|
|
|
- </foreach>
|
|
|
|
- </if>
|
|
|
|
- <if test="3 == type">
|
|
|
|
- r.clubId IS NOT NULL
|
|
|
|
- AND c.spId=1342
|
|
|
|
- </if>
|
|
|
|
|
|
+ LEFT JOIN cm_organ_value_system covs ON covs.userID = u.userID
|
|
|
|
+ where c.spID = #{serviceProviderId}
|
|
<if test="status != null and status != 66">
|
|
<if test="status != null and status != 66">
|
|
AND c.status = #{status}
|
|
AND c.status = #{status}
|
|
</if>
|
|
</if>
|
|
@@ -150,13 +132,11 @@
|
|
order by c.clubID desc
|
|
order by c.clubID desc
|
|
</select>
|
|
</select>
|
|
<select id="getAllClubList" resultType="com.caimei365.user.model.vo.ClubVo">
|
|
<select id="getAllClubList" resultType="com.caimei365.user.model.vo.ClubVo">
|
|
- SELECT DISTINCT c.clubID as clubId, c.userID as userId, c.name, c.sname as shortName, c.contractMobile,
|
|
|
|
- c.contractEmail as contractEmail,
|
|
|
|
|
|
+ SELECT DISTINCT c.clubID as clubId, c.userID as userId, c.name, c.sname as shortName, c.contractMobile, c.contractEmail as contractEmail,
|
|
c.contractPhone, c.linkMan, c.provinceID as proviceId, c.cityID as cityId, c.townID as townId,
|
|
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.address, c.headpic as shopPhoto, c.businessLicenseImage as businessLicense, c.socialCreditCode,
|
|
c.firstClubType, c.secondClubType, c.department, c.medicalPracticeLicenseImg as medicalPracticeLicense,
|
|
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,
|
|
|
|
- c.lastCheckOrderDate,
|
|
|
|
|
|
+ c.mainpro as mainProduct, c.fax, c.info as profile, c.spID as serviceProviderId, c.addTime, c.status, c.lastCheckOrderDate,
|
|
u.userIdentity
|
|
u.userIdentity
|
|
FROM club c
|
|
FROM club c
|
|
LEFT JOIN user u ON c.userID=u.userID
|
|
LEFT JOIN user u ON c.userID=u.userID
|
|
@@ -170,84 +150,26 @@
|
|
</if>
|
|
</if>
|
|
</select>
|
|
</select>
|
|
<select id="getSellerByUserId" resultType="com.caimei365.user.model.po.ServiceProviderPo">
|
|
<select id="getSellerByUserId" resultType="com.caimei365.user.model.po.ServiceProviderPo">
|
|
- select serviceProviderID AS serviceProviderId,
|
|
|
|
- status,
|
|
|
|
- userID AS userId,
|
|
|
|
- openid,
|
|
|
|
- unionId,
|
|
|
|
- name,
|
|
|
|
- contractMobile,
|
|
|
|
- linkMan,
|
|
|
|
- duty,
|
|
|
|
- contractEmail,
|
|
|
|
- auditStatus,
|
|
|
|
- auditTime,
|
|
|
|
- auditNote,
|
|
|
|
- validFlag,
|
|
|
|
- addTime,
|
|
|
|
|
|
+ select serviceProviderID AS serviceProviderId, status, userID AS userId, openid, unionId, name, contractMobile,
|
|
|
|
+ linkMan, duty, contractEmail, auditStatus, auditTime, auditNote, validFlag, addTime,
|
|
mainServiceProviderID AS mainServiceProviderId
|
|
mainServiceProviderID AS mainServiceProviderId
|
|
- from serviceprovider
|
|
|
|
- where userID = #{userId}
|
|
|
|
|
|
+ from serviceprovider where userID = #{userId}
|
|
</select>
|
|
</select>
|
|
<select id="findManager" resultType="java.lang.Integer">
|
|
<select id="findManager" resultType="java.lang.Integer">
|
|
- SELECT IF(csm.serviceProviderId IS NULL, 2, 1) AS manager
|
|
|
|
- FROM cm_serviceteam_manager csm
|
|
|
|
- LEFT JOIN serviceprovider s ON csm.serviceProviderId = s.serviceProviderId
|
|
|
|
- LEFT JOIN USER u ON s.userId = u.userId
|
|
|
|
- WHERE u.bindmobile = #{mobile}
|
|
|
|
- OR u.mobile = #{mobile}
|
|
|
|
|
|
+ SELECT IF(csm.serviceProviderId IS NULL,2,1) AS manager FROM cm_serviceteam_manager csm
|
|
|
|
+ LEFT JOIN serviceprovider s ON csm.serviceProviderId = s.serviceProviderId
|
|
|
|
+ LEFT JOIN USER u ON s.userId = u.userId
|
|
|
|
+ WHERE u.bindmobile = #{mobile} OR u.mobile = #{mobile}
|
|
</select>
|
|
</select>
|
|
<select id="findManagerByUser" resultType="java.lang.Integer">
|
|
<select id="findManagerByUser" resultType="java.lang.Integer">
|
|
- SELECT IF(csm.serviceProviderId IS NULL, 2, 1) AS manager
|
|
|
|
- FROM cm_serviceteam_manager csm
|
|
|
|
- LEFT JOIN serviceprovider s ON csm.serviceProviderId = s.serviceProviderId
|
|
|
|
- WHERE s.userID = #{userId}
|
|
|
|
|
|
+ SELECT IF(csm.serviceProviderId IS NULL,2,1) AS manager
|
|
|
|
+ FROM cm_serviceteam_manager csm
|
|
|
|
+ LEFT JOIN serviceprovider s ON csm.serviceProviderId = s.serviceProviderId
|
|
|
|
+ WHERE s.userID = #{userId}
|
|
</select>
|
|
</select>
|
|
<select id="findLeaderId" resultType="java.lang.Integer">
|
|
<select id="findLeaderId" resultType="java.lang.Integer">
|
|
- SELECT leaderId
|
|
|
|
- FROM cm_serviceteam_role csr
|
|
|
|
- LEFT JOIN serviceprovider s ON s.serviceProviderId = csr.leaderId
|
|
|
|
|
|
+ SELECT leaderId FROM cm_serviceteam_role csr
|
|
|
|
+ LEFT JOIN serviceprovider s ON s.serviceProviderId=csr.leaderId
|
|
WHERE s.userId = #{userId}
|
|
WHERE s.userId = #{userId}
|
|
</select>
|
|
</select>
|
|
- <select id="findLeaderIdByServiceId" resultType="java.lang.Integer">
|
|
|
|
- select leaderId
|
|
|
|
- FROM cm_serviceteam_role
|
|
|
|
- WHERE leaderId = #{serviceProviderId}
|
|
|
|
- </select>
|
|
|
|
- <select id="findmanagerIdByServiceId" resultType="java.lang.Integer">
|
|
|
|
- SELECT serviceProviderId
|
|
|
|
- FROM cm_serviceteam_manager
|
|
|
|
- where serviceProviderId = #{serviceProviderId}
|
|
|
|
- </select>
|
|
|
|
- <select id="findServiceIds" resultType="java.lang.Integer">
|
|
|
|
- SELECT csg.serviceId
|
|
|
|
- FROM cm_serviceteam_group csg
|
|
|
|
- LEFT JOIN cm_serviceteam_role csr ON csr.id = csg.teamId
|
|
|
|
- WHERE csr.leaderId = #{serviceProviderId}
|
|
|
|
- AND csg.serviceId != #{serviceProviderId}
|
|
|
|
- </select>
|
|
|
|
- <select id="findAllServiceIds" resultType="java.lang.Integer">
|
|
|
|
- SELECT csg.serviceId
|
|
|
|
- FROM cm_serviceteam_group csg
|
|
|
|
- WHERE csg.serviceId != #{serviceProviderId}
|
|
|
|
- </select>
|
|
|
|
- <select id="findServices" resultType="com.caimei365.user.model.vo.ServiceProviderVo">
|
|
|
|
- SELECT csg.serviceId as serviceProviderId,s.linkMan as name
|
|
|
|
- FROM cm_serviceteam_group csg
|
|
|
|
- LEFT JOIN cm_serviceteam_role csr ON csr.id=csg.teamId
|
|
|
|
- left join serviceprovider s on csg.serviceId=s.serviceProviderID
|
|
|
|
- WHERE csr.leaderId = #{spId}
|
|
|
|
- <if test="status == 1">
|
|
|
|
- AND csg.serviceId != #{spId}
|
|
|
|
- </if>
|
|
|
|
- </select>
|
|
|
|
- <select id="findAllServices" resultType="com.caimei365.user.model.vo.ServiceProviderVo">
|
|
|
|
- SELECT csg.serviceId AS serviceProviderId,s.linkMan AS NAME
|
|
|
|
- FROM cm_serviceteam_group csg
|
|
|
|
- LEFT JOIN serviceprovider s ON csg.serviceId=s.serviceProviderID
|
|
|
|
- <if test="status == 1">
|
|
|
|
- WHERE csg.serviceId != #{spId}
|
|
|
|
- </if>
|
|
|
|
- </select>
|
|
|
|
-
|
|
|
|
</mapper>
|
|
</mapper>
|