|
@@ -2,90 +2,92 @@
|
|
<!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>
|
|
|
|
|
|
<delete id="deleteTemporaryClub">
|
|
<delete id="deleteTemporaryClub">
|
|
- DELETE FROM `club_temporary` WHERE `id` = #{id}
|
|
|
|
|
|
+ DELETE
|
|
|
|
+ FROM `club_temporary`
|
|
|
|
+ WHERE `id` = #{id}
|
|
</delete>
|
|
</delete>
|
|
|
|
|
|
<select id="findOrderNum" resultType="integer">
|
|
<select id="findOrderNum" resultType="integer">
|
|
@@ -102,20 +104,22 @@
|
|
</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,
|
|
|
|
|
|
+ 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
|
|
u.userIdentity,c.newDeal as newDeal,IF(r.id IS NOT NULL,1,0) AS recordCount
|
|
<if test="2 == type">
|
|
<if test="2 == type">
|
|
- ,s.linkMan as serviceName
|
|
|
|
|
|
+ ,s.linkMan as serviceName
|
|
</if>
|
|
</if>
|
|
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">
|
|
<if test="2 == type">
|
|
- left join serviceprovider s on s.serviceProviderID=c.spID
|
|
|
|
|
|
+ left join serviceprovider s on s.serviceProviderID=c.spID
|
|
</if>
|
|
</if>
|
|
where
|
|
where
|
|
<if test="1 == type">
|
|
<if test="1 == type">
|
|
@@ -146,11 +150,13 @@
|
|
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
|
|
@@ -164,26 +170,43 @@
|
|
</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 id="findLeaderIdByServiceId" resultType="java.lang.Integer">
|
|
@@ -199,27 +222,32 @@
|
|
<select id="findServiceIds" resultType="java.lang.Integer">
|
|
<select id="findServiceIds" resultType="java.lang.Integer">
|
|
SELECT csg.serviceId
|
|
SELECT csg.serviceId
|
|
FROM cm_serviceteam_group csg
|
|
FROM cm_serviceteam_group csg
|
|
- LEFT JOIN cm_serviceteam_role csr ON csr.id=csg.teamId
|
|
|
|
|
|
+ LEFT JOIN cm_serviceteam_role csr ON csr.id = csg.teamId
|
|
WHERE csr.leaderId = #{serviceProviderId}
|
|
WHERE csr.leaderId = #{serviceProviderId}
|
|
AND csg.serviceId != #{serviceProviderId}
|
|
AND csg.serviceId != #{serviceProviderId}
|
|
</select>
|
|
</select>
|
|
<select id="findAllServiceIds" resultType="java.lang.Integer">
|
|
<select id="findAllServiceIds" resultType="java.lang.Integer">
|
|
- SELECT csg.serviceId FROM cm_serviceteam_group csg
|
|
|
|
|
|
+ SELECT csg.serviceId
|
|
|
|
+ FROM cm_serviceteam_group csg
|
|
WHERE csg.serviceId != #{serviceProviderId}
|
|
WHERE csg.serviceId != #{serviceProviderId}
|
|
</select>
|
|
</select>
|
|
<select id="findServices" resultType="com.caimei365.user.model.vo.ServiceProviderVo">
|
|
<select id="findServices" resultType="com.caimei365.user.model.vo.ServiceProviderVo">
|
|
SELECT csg.serviceId as serviceProviderId,s.linkMan as name
|
|
SELECT csg.serviceId as serviceProviderId,s.linkMan as name
|
|
FROM cm_serviceteam_group csg
|
|
FROM cm_serviceteam_group csg
|
|
- LEFT JOIN cm_serviceteam_role csr ON csr.id=csg.teamId
|
|
|
|
|
|
+ LEFT JOIN cm_serviceteam_role csr ON csr.id=csg.teamId
|
|
left join serviceprovider s on csg.serviceId=s.serviceProviderID
|
|
left join serviceprovider s on csg.serviceId=s.serviceProviderID
|
|
WHERE csr.leaderId = #{spId}
|
|
WHERE csr.leaderId = #{spId}
|
|
- AND csg.serviceId != #{spId}
|
|
|
|
|
|
+ <if test="status == 1">
|
|
|
|
+ AND csg.serviceId != #{spId}
|
|
|
|
+ </if>
|
|
</select>
|
|
</select>
|
|
<select id="findAllServices" resultType="com.caimei365.user.model.vo.ServiceProviderVo">
|
|
<select id="findAllServices" resultType="com.caimei365.user.model.vo.ServiceProviderVo">
|
|
SELECT csg.serviceId AS serviceProviderId,s.linkMan AS NAME
|
|
SELECT csg.serviceId AS serviceProviderId,s.linkMan AS NAME
|
|
FROM cm_serviceteam_group csg
|
|
FROM cm_serviceteam_group csg
|
|
LEFT JOIN serviceprovider s ON csg.serviceId=s.serviceProviderID
|
|
LEFT JOIN serviceprovider s ON csg.serviceId=s.serviceProviderID
|
|
- WHERE csg.serviceId != #{spId}
|
|
|
|
|
|
+ <if test="status == 1">
|
|
|
|
+ WHERE csg.serviceId != #{spId}
|
|
|
|
+ </if>
|
|
</select>
|
|
</select>
|
|
|
|
|
|
</mapper>
|
|
</mapper>
|