|
@@ -4,164 +4,139 @@
|
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
<mapper namespace="com.caimei365.manager.dao.providers.CmProvidersMapper">
|
|
<mapper namespace="com.caimei365.manager.dao.providers.CmProvidersMapper">
|
|
|
|
|
|
- <resultMap type="CmProviders" id="CmProvidersResult">
|
|
|
|
- <result property="id" column="id"/>
|
|
|
|
- <result property="name" column="name"/>
|
|
|
|
- <result property="serviceLevel" column="serviceLevel"/>
|
|
|
|
- <result property="serviceCategory" column="serviceCategory"/>
|
|
|
|
- <result property="address" column="address"/>
|
|
|
|
- <result property="linkMan" column="linkMan"/>
|
|
|
|
- <result property="mobile" column="mobile"/>
|
|
|
|
- <result property="text" column="text"/>
|
|
|
|
- <result property="qrCodeImage" column="qrCodeImage"/>
|
|
|
|
- <result property="qualificationImage" column="qualificationImage"/>
|
|
|
|
- <result property="qualificationId" column="qualificationId"/>
|
|
|
|
- <result property="contractStartDate" column="contractStartDate"/>
|
|
|
|
- <result property="contractEntDate" column="contractEntDate"/>
|
|
|
|
- <result property="createBy" column="createBy"/>
|
|
|
|
- <result property="updateTime" column="updateTime"/>
|
|
|
|
- <result property="createTime" column="createTime"/>
|
|
|
|
- <result property="userId" column="userId"/>
|
|
|
|
- <result property="status" column="status"/>
|
|
|
|
- </resultMap>
|
|
|
|
-
|
|
|
|
- <sql id="selectCmProvidersVo">
|
|
|
|
- select cm_providers.id,
|
|
|
|
- cm_providers.name,
|
|
|
|
- cm_providers.serviceLevel,
|
|
|
|
- cm_providers.serviceCategory,
|
|
|
|
- cm_providers.status,
|
|
|
|
- cm_providers.userId,
|
|
|
|
- cm_providers.address,
|
|
|
|
- cm_providers.linkMan,
|
|
|
|
- cm_providers.mobile,
|
|
|
|
- cm_providers.text,
|
|
|
|
- cm_providers.brandName,
|
|
|
|
- cm_providers.qrCodeImage,
|
|
|
|
- cm_providers.qualificationImage,
|
|
|
|
- cm_providers.qualificationId,
|
|
|
|
- cm_providers.createBy,
|
|
|
|
- cm_providers.updateTime,
|
|
|
|
- cm_providers.createTime,
|
|
|
|
- cm_providers.splitCode
|
|
|
|
- </sql>
|
|
|
|
-
|
|
|
|
- <select id="getByCmProviders" parameterType="CmProviders" resultMap="CmProvidersResult">
|
|
|
|
- <include refid="selectCmProvidersVo"/>
|
|
|
|
- from cm_providers AS cm_providers
|
|
|
|
|
|
+ <select id="getByCmProviders" parameterType="com.caimei365.manager.entity.caimei.providers.ServiceProviderModel"
|
|
|
|
+ resultType="com.caimei365.manager.entity.caimei.providers.ServiceProviderModel">
|
|
|
|
+ select
|
|
|
|
+ serviceProviderId,
|
|
|
|
+ name,
|
|
|
|
+ serviceLevel,
|
|
|
|
+ serviceCategory,
|
|
|
|
+ status,
|
|
|
|
+ userId,
|
|
|
|
+ address,
|
|
|
|
+ linkMan,
|
|
|
|
+ contractMobile as mobile,
|
|
|
|
+ text,
|
|
|
|
+ brandName,
|
|
|
|
+ qrCodeImage,
|
|
|
|
+ qualificationImage,
|
|
|
|
+ qualificationId,
|
|
|
|
+ createBy,
|
|
|
|
+ addTime,
|
|
|
|
+ splitCode
|
|
|
|
+ from serviceprovider
|
|
<where>
|
|
<where>
|
|
- <if test="id != null and id != ''">and cm_providers.id = #{id}</if>
|
|
|
|
- <if test="name != null and name != ''">and cm_providers.name like concat('%', #{name}, '%')</if>
|
|
|
|
- <if test="serviceLevel != null ">and cm_providers.serviceLevel = #{serviceLevel}</if>
|
|
|
|
- <if test="serviceCategory != null ">and cm_providers.serviceCategory = #{serviceCategory}</if>
|
|
|
|
- <if test="status != null ">and cm_providers.status = #{status}</if>
|
|
|
|
- <if test="userId != null ">and cm_providers.userId = #{userId}</if>
|
|
|
|
- <if test="address != null and address != ''">and cm_providers.address = #{address}</if>
|
|
|
|
- <if test="linkMan != null and linkMan != ''">and cm_providers.linkMan = #{linkMan}</if>
|
|
|
|
- <if test="mobile != null and mobile != ''">and cm_providers.mobile = #{mobile}</if>
|
|
|
|
- <if test="text != null and text != ''">and cm_providers.text = #{text}</if>
|
|
|
|
- <if test="qrCodeImage != null and qrCodeImage != ''">and cm_providers.qrCodeImage = #{qrCodeImage}</if>
|
|
|
|
- <if test="qualificationImage != null and qualificationImage != ''">and cm_providers.qualificationImage =
|
|
|
|
- #{qualificationImage}
|
|
|
|
- </if>
|
|
|
|
- <if test="qualificationId != null and qualificationId != ''">and cm_providers.qualificationId =
|
|
|
|
- #{qualificationId}
|
|
|
|
|
|
+ <if test="serviceProviderId != null and serviceProviderId != ''">
|
|
|
|
+ and serviceProviderId = #{serviceProviderId}
|
|
</if>
|
|
</if>
|
|
|
|
+ <if test="name != null and name != ''">and name like concat('%', #{name}, '%')</if>
|
|
|
|
+ <if test="serviceLevel != null ">and serviceLevel = #{serviceLevel}</if>
|
|
|
|
+ <if test="serviceCategory != null ">and cserviceCategory = #{serviceCategory}</if>
|
|
|
|
+ <if test="status != null ">and status = #{status}</if>
|
|
|
|
+ <if test="userId != null ">and userId = #{userId}</if>
|
|
|
|
+ <if test="address != null and address != ''">and address = #{address}</if>
|
|
|
|
+ <if test="linkMan != null and linkMan != ''">andlinkMan = #{linkMan}</if>
|
|
|
|
+ <if test="mobile != null and mobile != ''">and contractMobile = #{mobile}</if>
|
|
</where>
|
|
</where>
|
|
- group by cm_providers.id
|
|
|
|
- order by cm_providers.createTime desc
|
|
|
|
|
|
+ group by serviceProviderId
|
|
|
|
+ order by addTime desc
|
|
limit 0,1
|
|
limit 0,1
|
|
</select>
|
|
</select>
|
|
|
|
|
|
- <select id="getCmProvidersList" parameterType="CmProviders" resultMap="CmProvidersResult">
|
|
|
|
- <include refid="selectCmProvidersVo"/>
|
|
|
|
- ,cm_providers_contract.contractStartDate
|
|
|
|
- ,cm_providers_contract.contractEndDate
|
|
|
|
- from cm_providers AS cm_providers
|
|
|
|
- LEFT JOIN cm_providers_contract as cm_providers_contract ON cm_providers_contract.providersId = cm_providers.id
|
|
|
|
|
|
+ <select id="getCmProvidersList" parameterType="com.caimei365.manager.entity.caimei.providers.ServiceProviderModel"
|
|
|
|
+ resultType="com.caimei365.manager.entity.caimei.providers.ServiceProviderModel">
|
|
|
|
+ select
|
|
|
|
+ sp.serviceProviderId,
|
|
|
|
+ sp.name,
|
|
|
|
+ sp.serviceLevel,
|
|
|
|
+ sp.serviceCategory,
|
|
|
|
+ sp.status,
|
|
|
|
+ sp.userId,
|
|
|
|
+ sp.address,
|
|
|
|
+ sp.linkMan,
|
|
|
|
+ sp.contractMobile as mobile,
|
|
|
|
+ sp.text,
|
|
|
|
+ sp.brandName,
|
|
|
|
+ sp.qrCodeImage,
|
|
|
|
+ sp.qualificationImage,
|
|
|
|
+ sp.qualificationId,
|
|
|
|
+ sp.createBy,
|
|
|
|
+ sp.addTime,
|
|
|
|
+ sp.splitCode,
|
|
|
|
+ sp.insiderFlag,
|
|
|
|
+ cm_providers_contract.contractStartDate,
|
|
|
|
+ cm_providers_contract.contractEndDate
|
|
|
|
+ from serviceprovider AS sp
|
|
|
|
+ LEFT JOIN cm_providers_contract as cm_providers_contract ON cm_providers_contract.providersId =
|
|
|
|
+ sp.serviceProviderId
|
|
<where>
|
|
<where>
|
|
- <if test="id != null and id != ''">and cm_providers.id = #{id}</if>
|
|
|
|
- <if test="name != null and name != ''">and cm_providers.name like concat('%', #{name}, '%')</if>
|
|
|
|
- <if test="serviceLevel != null ">and cm_providers.serviceLevel = #{serviceLevel}</if>
|
|
|
|
- <if test="status != null ">and cm_providers.status = #{status}</if>
|
|
|
|
- <if test="userId != null ">and cm_providers.userId = #{userId}</if>
|
|
|
|
- <if test="serviceCategory != null ">and cm_providers.serviceCategory = #{serviceCategory}</if>
|
|
|
|
- <if test="address != null and address != ''">and cm_providers.address = #{address}</if>
|
|
|
|
- <if test="linkMan != null and linkMan != ''">and cm_providers.linkMan = #{linkMan}</if>
|
|
|
|
- <if test="mobile != null and mobile != ''">and cm_providers.mobile = #{mobile}</if>
|
|
|
|
- <if test="text != null and text != ''">and cm_providers.text = #{text}</if>
|
|
|
|
- <if test="qrCodeImage != null and qrCodeImage != ''">and cm_providers.qrCodeImage = #{qrCodeImage}</if>
|
|
|
|
- <if test="qualificationImage != null and qualificationImage != ''">and cm_providers.qualificationImage =
|
|
|
|
- #{qualificationImage}
|
|
|
|
- </if>
|
|
|
|
- <if test="qualificationId != null and qualificationId != ''">and cm_providers.qualificationId =
|
|
|
|
- #{qualificationId}
|
|
|
|
- </if>
|
|
|
|
- <if test="contractStartDate != null ">and cm_providers_contract.contractStartDate >= #{contractStartDate}
|
|
|
|
- </if>
|
|
|
|
- <if test="contractEndDate != null ">and cm_providers_contract.contractEndDate <![CDATA[ <= ]]>
|
|
|
|
- #{contractEndDate}
|
|
|
|
|
|
+ <if test="serviceProviderId != null and serviceProviderId != ''">
|
|
|
|
+ and sp.serviceProviderId = #{serviceProviderId}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="name != null and name != ''">and sp.name like concat('%', #{name}, '%')</if>
|
|
|
|
+ <if test="serviceLevel != null ">and sp.serviceLevel = #{serviceLevel}</if>
|
|
|
|
+ <if test="status != null ">and sp.status = #{status}</if>
|
|
|
|
+ <if test="userId != null ">and sp.userId = #{userId}</if>
|
|
|
|
+ <if test="serviceCategory != null ">and sp.serviceCategory = #{serviceCategory}</if>
|
|
|
|
+ <if test="address != null and address != ''">and sp.address = #{address}</if>
|
|
|
|
+ <if test="linkMan != null and linkMan != ''">and sp.linkMan = #{linkMan}</if>
|
|
|
|
+ <if test="mobile != null and mobile != ''">and sp.contractMobile = #{mobile}</if>
|
|
|
|
+ <if test="qualificationId != null and qualificationId != ''">
|
|
|
|
+ and sp.qualificationId = #{qualificationId}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="contractStartDate != null ">
|
|
|
|
+ and cm_providers_contract.contractStartDate >= #{contractStartDate}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="contractEndDate != null ">
|
|
|
|
+ and cm_providers_contract.contractEndDate <![CDATA[ <= ]]> #{contractEndDate}
|
|
</if>
|
|
</if>
|
|
</where>
|
|
</where>
|
|
- group by cm_providers.id
|
|
|
|
- order by cm_providers.createTime desc
|
|
|
|
|
|
+ group by sp.serviceProviderId
|
|
|
|
+ order by sp.addTime desc
|
|
</select>
|
|
</select>
|
|
|
|
|
|
- <select id="getCount" parameterType="CmProviders" resultType="int">
|
|
|
|
|
|
+ <select id="getCount" parameterType="com.caimei365.manager.entity.caimei.providers.ServiceProviderModel"
|
|
|
|
+ resultType="int">
|
|
select count(1)
|
|
select count(1)
|
|
- from cm_providers AS cm_providers
|
|
|
|
|
|
+ from serviceprovider
|
|
<where>
|
|
<where>
|
|
- <if test="id != null and id != ''">and cm_providers.id = #{id}</if>
|
|
|
|
- <if test="name != null and name != ''">and cm_providers.name like concat('%', #{name}, '%')</if>
|
|
|
|
- <if test="serviceLevel != null ">and cm_providers.serviceLevel = #{serviceLevel}</if>
|
|
|
|
- <if test="userId != null ">and cm_providers.userId = #{userId}</if>
|
|
|
|
- <if test="status != null ">and cm_providers.status = #{status}</if>
|
|
|
|
- <if test="serviceCategory != null ">and cm_providers.serviceCategory = #{serviceCategory}</if>
|
|
|
|
- <if test="address != null and address != ''">and cm_providers.address = #{address}</if>
|
|
|
|
- <if test="linkMan != null and linkMan != ''">and cm_providers.linkMan = #{linkMan}</if>
|
|
|
|
- <if test="mobile != null and mobile != ''">and cm_providers.mobile = #{mobile}</if>
|
|
|
|
- <if test="text != null and text != ''">and cm_providers.text = #{text}</if>
|
|
|
|
- <if test="qrCodeImage != null and qrCodeImage != ''">and cm_providers.qrCodeImage = #{qrCodeImage}</if>
|
|
|
|
- <if test="qualificationImage != null and qualificationImage != ''">and cm_providers.qualificationImage =
|
|
|
|
- #{qualificationImage}
|
|
|
|
- </if>
|
|
|
|
- <if test="qualificationId != null and qualificationId != ''">and cm_providers.qualificationId =
|
|
|
|
- #{qualificationId}
|
|
|
|
|
|
+ <if test="serviceProviderId != null and serviceProviderId != ''">
|
|
|
|
+ and serviceProviderId = #{serviceProviderId}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="name != null and name != ''">and name like concat('%', #{name}, '%')</if>
|
|
|
|
+ <if test="serviceLevel != null ">and serviceLevel = #{serviceLevel}</if>
|
|
|
|
+ <if test="userId != null ">and userId = #{userId}</if>
|
|
|
|
+ <if test="status != null ">and status = #{status}</if>
|
|
|
|
+ <if test="serviceCategory != null ">and serviceCategory = #{serviceCategory}</if>
|
|
|
|
+ <if test="address != null and address != ''">and address = #{address}</if>
|
|
|
|
+ <if test="mobile != null and mobile != ''">and contractMobile = #{mobile}</if>
|
|
|
|
+ <if test="qualificationId != null and qualificationId != ''">
|
|
|
|
+ and qualificationId = #{qualificationId}
|
|
</if>
|
|
</if>
|
|
</where>
|
|
</where>
|
|
</select>
|
|
</select>
|
|
|
|
|
|
- <select id="getCmProvidersById" parameterType="String" resultMap="CmProvidersResult">
|
|
|
|
- <include refid="selectCmProvidersVo"/>
|
|
|
|
- from cm_providers AS cm_providers
|
|
|
|
- where cm_providers.id = #{id}
|
|
|
|
- </select>
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- <select id="getById" parameterType="CmProviders" resultType="String">
|
|
|
|
- select id
|
|
|
|
- from cm_providers AS cm_providers
|
|
|
|
- <where>
|
|
|
|
- <if test="id != null and id != ''">and cm_providers.id = #{id}</if>
|
|
|
|
- <if test="name != null and name != ''">and cm_providers.name like concat('%', #{name}, '%')</if>
|
|
|
|
- <if test="serviceLevel != null ">and cm_providers.serviceLevel = #{serviceLevel}</if>
|
|
|
|
- <if test="serviceCategory != null ">and cm_providers.serviceCategory = #{serviceCategory}</if>
|
|
|
|
- <if test="status != null ">and cm_providers.status = #{status}</if>
|
|
|
|
- <if test="userId != null ">and cm_providers.userId = #{userId}</if>
|
|
|
|
- <if test="address != null and address != ''">and cm_providers.address = #{address}</if>
|
|
|
|
- <if test="linkMan != null and linkMan != ''">and cm_providers.linkMan = #{linkMan}</if>
|
|
|
|
- <if test="mobile != null and mobile != ''">and cm_providers.mobile = #{mobile}</if>
|
|
|
|
- <if test="text != null and text != ''">and cm_providers.text = #{text}</if>
|
|
|
|
- <if test="qrCodeImage != null and qrCodeImage != ''">and cm_providers.qrCodeImage = #{qrCodeImage}</if>
|
|
|
|
- <if test="qualificationImage != null and qualificationImage != ''">and cm_providers.qualificationImage =
|
|
|
|
- #{qualificationImage}
|
|
|
|
- </if>
|
|
|
|
- <if test="qualificationId != null and qualificationId != ''">and cm_providers.qualificationId =
|
|
|
|
- #{qualificationId}
|
|
|
|
- </if>
|
|
|
|
- </where>
|
|
|
|
- group by cm_providers.id
|
|
|
|
- limit 0,1
|
|
|
|
|
|
+ <select id="getCmProvidersById" resultType="com.caimei365.manager.entity.caimei.providers.ServiceProviderModel">
|
|
|
|
+ select serviceProviderId,
|
|
|
|
+ name,
|
|
|
|
+ serviceLevel,
|
|
|
|
+ serviceCategory,
|
|
|
|
+ status,
|
|
|
|
+ userId,
|
|
|
|
+ address,
|
|
|
|
+ linkMan,
|
|
|
|
+ contractMobile as mobile,
|
|
|
|
+ text,
|
|
|
|
+ brandName,
|
|
|
|
+ insiderFlag,
|
|
|
|
+ qrCodeImage,
|
|
|
|
+ qualificationImage,
|
|
|
|
+ qualificationId,
|
|
|
|
+ createBy,
|
|
|
|
+ addTime,
|
|
|
|
+ splitCode
|
|
|
|
+ from serviceprovider
|
|
|
|
+ where serviceProviderId = #{id}
|
|
</select>
|
|
</select>
|
|
|
|
|
|
<select id="getProvidersUploadFileList" resultType="UploadFilePo">
|
|
<select id="getProvidersUploadFileList" resultType="UploadFilePo">
|
|
@@ -173,17 +148,18 @@
|
|
qrCodeImage as fileUrl,
|
|
qrCodeImage as fileUrl,
|
|
</if>
|
|
</if>
|
|
name as fileName
|
|
name as fileName
|
|
- from cm_providers AS cm_providers
|
|
|
|
|
|
+ from serviceprovider AS sp
|
|
<where>
|
|
<where>
|
|
- cm_providers.id in
|
|
|
|
|
|
+ sp.serviceProviderId in
|
|
<foreach item="idsIn"
|
|
<foreach item="idsIn"
|
|
collection="ids.split(',')"
|
|
collection="ids.split(',')"
|
|
open="(" separator="," close=")">
|
|
open="(" separator="," close=")">
|
|
#{idsIn}
|
|
#{idsIn}
|
|
</foreach>
|
|
</foreach>
|
|
</where>
|
|
</where>
|
|
- group by cm_providers.id
|
|
|
|
|
|
+ group by sp.serviceProviderId
|
|
</select>
|
|
</select>
|
|
|
|
+
|
|
<select id="getProductList" resultType="com.caimei365.manager.entity.caimei.product.Product">
|
|
<select id="getProductList" resultType="com.caimei365.manager.entity.caimei.product.Product">
|
|
SELECT
|
|
SELECT
|
|
p.productId,
|
|
p.productId,
|
|
@@ -211,6 +187,7 @@
|
|
</if>
|
|
</if>
|
|
</where>
|
|
</where>
|
|
</select>
|
|
</select>
|
|
|
|
+
|
|
<select id="getProviderProductList" resultType="com.caimei365.manager.entity.caimei.product.Product">
|
|
<select id="getProviderProductList" resultType="com.caimei365.manager.entity.caimei.product.Product">
|
|
SELECT
|
|
SELECT
|
|
p.productId,
|
|
p.productId,
|
|
@@ -234,31 +211,165 @@
|
|
</where>
|
|
</where>
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
|
+ <select id="getProviderTeam" resultType="com.caimei365.manager.entity.caimei.providers.CmProviderTeam">
|
|
|
|
+ SELECT DISTINCT csr.leaderId,
|
|
|
|
+ csr.createdTime,
|
|
|
|
+ s.name as leaderName,
|
|
|
|
+ csr.id as teamId,
|
|
|
|
+ csr.name,
|
|
|
|
+ (SELECT COUNT(teamId) FROM cm_serviceteam_group WHERE teamId = csr.id) AS groupCount
|
|
|
|
+ FROM cm_serviceteam_role csr
|
|
|
|
+ LEFT JOIN serviceprovider s ON csr.leaderId = s.serviceProviderID
|
|
|
|
+ order by csr.createdTime desc
|
|
|
|
+ </select>
|
|
|
|
|
|
- <insert id="addCmProviders" parameterType="CmProviders" useGeneratedKeys="true" keyProperty="id">
|
|
|
|
- insert into cm_providers
|
|
|
|
|
|
+ <select id="findClub" resultType="com.caimei365.manager.entity.caimei.cmUser.CmClub">
|
|
|
|
+ SELECT
|
|
|
|
+ a.checkMan as "checkMan",
|
|
|
|
+ a.clubID AS "clubId",
|
|
|
|
+ a.userID AS "userId",
|
|
|
|
+ u.name AS "name",
|
|
|
|
+ a.sname AS "sname",
|
|
|
|
+ a.logo AS "logo",
|
|
|
|
+ a.legalPerson AS "legalPerson",
|
|
|
|
+ a.provinceID AS "provinceId",
|
|
|
|
+ a.cityID AS "cityId",
|
|
|
|
+ a.townID AS "townId",
|
|
|
|
+ a.flag AS "flag",
|
|
|
|
+ a.spID AS "spId",
|
|
|
|
+ a.address AS "address",
|
|
|
|
+ a.linkMan AS "linkMan",
|
|
|
|
+ a.linkManIdentity AS "linkManIdentity",
|
|
|
|
+ a.contractPhone AS "contractPhone",
|
|
|
|
+ a.contractMobile AS "contractMobile",
|
|
|
|
+ a.fax AS "fax",
|
|
|
|
+ a.info AS "info",
|
|
|
|
+ a.addTime AS "addTime",
|
|
|
|
+ a.auditTime AS "auditTime",
|
|
|
|
+ a.auditNote AS "auditNote",
|
|
|
|
+ a.status AS "status",
|
|
|
|
+ a.businessLicenseImage AS "businessLicenseImage",
|
|
|
|
+ a.mainpro AS "mainpro",
|
|
|
|
+ a.scanFlag AS "scanFlag",
|
|
|
|
+ a.headpic AS "headpic",
|
|
|
|
+ a.socialCreditCode AS "socialCreditCode",
|
|
|
|
+ a.lastModify AS "lastModify",
|
|
|
|
+ a.firstClubType AS "firstClubType",
|
|
|
|
+ a.secondClubType AS "secondClubType",
|
|
|
|
+ a.department AS "department",
|
|
|
|
+ a.medicalPracticeLicenseImg AS "medicalPracticeLicenseImg",
|
|
|
|
+ a.newDeal as "newDeal",
|
|
|
|
+ case sp.status when 91 then '采美默认协销经理(官方账号)' else sp.linkMan end AS "spName",
|
|
|
|
+ d.name AS "province",
|
|
|
|
+ c.name AS "city",
|
|
|
|
+ b.name AS "town",
|
|
|
|
+ u.account AS "account",
|
|
|
|
+ u.registerTime AS "registerTime",
|
|
|
|
+ u.registerIP AS "registerIP",
|
|
|
|
+ u.userName AS "userName",
|
|
|
|
+ u.bindMobile AS "bindMobile",
|
|
|
|
+ u.email AS "email",
|
|
|
|
+ u.userOrganizeID AS "userOrganizeId",
|
|
|
|
+ u.userIdentity AS "userIdentity",
|
|
|
|
+ if(csu.delFlag = '0' and now() <![CDATA[ < ]]> csu.endTime,1,0) as svipUserFlag,
|
|
|
|
+ u.source,
|
|
|
|
+ u.loginTime
|
|
|
|
+ FROM club a
|
|
|
|
+ LEFT JOIN user u ON u.userID = a.userID
|
|
|
|
+ LEFT JOIN cm_svip_user csu ON csu.userId = u.userID
|
|
|
|
+ LEFT JOIN serviceprovider sp ON sp.serviceProviderID = a.spID
|
|
|
|
+ LEFT JOIN town b ON b.townID=a.townID
|
|
|
|
+ LEFT JOIN city c ON c.cityID=a.cityID
|
|
|
|
+ LEFT JOIN province d ON d.provinceID=a.provinceID
|
|
|
|
+ <where>
|
|
|
|
+ (u.userOrganizeID IN(0,1) or u.clubStatus != 92) and u.userOrganizeID != 4 AND u.userIdentity != 8
|
|
|
|
+ <if test="clubId != null and clubId != ''">
|
|
|
|
+ AND a.clubID = #{clubId}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="clubId == 0">
|
|
|
|
+ AND a.clubID = #{clubId}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="userId != null and userId != ''">
|
|
|
|
+ AND a.userID = #{userId}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="account != null and account != ''">
|
|
|
|
+ AND u.account = #{account}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="name != null and name != ''">
|
|
|
|
+ AND u.name LIKE concat('%',#{name},'%')
|
|
|
|
+ </if>
|
|
|
|
+ <if test="userName != null and userName != ''">
|
|
|
|
+ AND u.userName LIKE concat('%',#{userName},'%')
|
|
|
|
+ </if>
|
|
|
|
+ <if test="townId != null and townId != ''">
|
|
|
|
+ AND d.provinceID = #{provinceId}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="cityId != null and cityId != ''">
|
|
|
|
+ AND c.cityID = #{cityId}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="townId != null and townId != ''">
|
|
|
|
+ AND b.townID = #{townId}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="status != null and status != ''">
|
|
|
|
+ AND a.status = #{status}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="bindMobile != null and bindMobile != ''">
|
|
|
|
+ AND u.bindMobile LIKE concat('%',#{bindMobile},'%')
|
|
|
|
+ </if>
|
|
|
|
+ <if test="linkMan != null and linkMan != ''">
|
|
|
|
+ AND a.linkMan LIKE concat('%',#{linkMan},'%')
|
|
|
|
+ </if>
|
|
|
|
+ <if test="startTime != null and startTime != ''">
|
|
|
|
+ AND u.registerTime <![CDATA[ >= ]]> #{startTime}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="endTime != null and endTime != ''">
|
|
|
|
+ AND u.registerTime <![CDATA[ <= ]]> #{endTime}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="spId != null and spId != ''">
|
|
|
|
+ AND sp.serviceProviderID = #{spId}
|
|
|
|
+ </if>
|
|
|
|
+ </where>
|
|
|
|
+ ORDER BY case when a.status = 91 then 0 else 1 end desc, a.addTime DESC
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+ <select id="groupList" resultType="com.caimei365.manager.entity.caimei.providers.ServiceProviderModel">
|
|
|
|
+ SELECT csg.serviceId AS serviceProviderId,
|
|
|
|
+ s.name as name,
|
|
|
|
+ s.contractMobile as mobile,
|
|
|
|
+ csr.leaderId as leaderId
|
|
|
|
+ FROM cm_serviceTeam_group csg
|
|
|
|
+ LEFT JOIN serviceprovider s ON csg.serviceId = s.serviceProviderID
|
|
|
|
+ LEFT JOIN cm_serviceteam_role csr ON csg.teamId = csr.id
|
|
|
|
+ WHERE csg.teamId = #{id}
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ <insert id="addCmProviders" parameterType="com.caimei365.manager.entity.caimei.providers.ServiceProviderModel"
|
|
|
|
+ useGeneratedKeys="true" keyProperty="serviceProviderId">
|
|
|
|
+ insert into serviceprovider
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
- <if test="id != null and id != ''">id,</if>
|
|
|
|
|
|
+ <if test="serviceProviderId != null and serviceProviderId != ''">id,</if>
|
|
|
|
+ <if test="insiderFlag != null and insiderFlag != ''">insiderFlag,</if>
|
|
<if test="name != null and name != ''">name,</if>
|
|
<if test="name != null and name != ''">name,</if>
|
|
<if test="serviceLevel != null">serviceLevel,</if>
|
|
<if test="serviceLevel != null">serviceLevel,</if>
|
|
<if test="serviceCategory != null">serviceCategory,</if>
|
|
<if test="serviceCategory != null">serviceCategory,</if>
|
|
<if test="address != null and address != ''">address,</if>
|
|
<if test="address != null and address != ''">address,</if>
|
|
<if test="linkMan != null and linkMan != ''">linkMan,</if>
|
|
<if test="linkMan != null and linkMan != ''">linkMan,</if>
|
|
- <if test="mobile != null and mobile != ''">mobile,</if>
|
|
|
|
|
|
+ <if test="mobile != null and mobile != ''">contractMobile,</if>
|
|
<if test="text != null and text != ''">text,</if>
|
|
<if test="text != null and text != ''">text,</if>
|
|
<if test="qrCodeImage != null and qrCodeImage != ''">qrCodeImage,</if>
|
|
<if test="qrCodeImage != null and qrCodeImage != ''">qrCodeImage,</if>
|
|
<if test="qualificationImage != null and qualificationImage != ''">qualificationImage,</if>
|
|
<if test="qualificationImage != null and qualificationImage != ''">qualificationImage,</if>
|
|
<if test="qualificationId != null and qualificationId != ''">qualificationId,</if>
|
|
<if test="qualificationId != null and qualificationId != ''">qualificationId,</if>
|
|
<if test="createBy != null and createBy != ''">createBy,</if>
|
|
<if test="createBy != null and createBy != ''">createBy,</if>
|
|
- <if test="updateTime != null">updateTime,</if>
|
|
|
|
- <if test="createTime != null">createTime,</if>
|
|
|
|
|
|
+ <if test="addTime != null">addTime,</if>
|
|
<if test="status != null">status,</if>
|
|
<if test="status != null">status,</if>
|
|
<if test="userId != null">userId,</if>
|
|
<if test="userId != null">userId,</if>
|
|
<if test="brandName != null and brandName != ''">brandName,</if>
|
|
<if test="brandName != null and brandName != ''">brandName,</if>
|
|
<if test="splitCode != null and splitCode != ''">splitCode,</if>
|
|
<if test="splitCode != null and splitCode != ''">splitCode,</if>
|
|
</trim>
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
- <if test="id != null and id != ''">#{id},</if>
|
|
|
|
|
|
+ <if test="serviceProviderId != null and serviceProviderId != ''">#{serviceProviderId},</if>
|
|
|
|
+ <if test="insiderFlag != null and insiderFlag != ''">#{insiderFlag},</if>
|
|
<if test="name != null and name != ''">#{name},</if>
|
|
<if test="name != null and name != ''">#{name},</if>
|
|
<if test="serviceLevel != null">#{serviceLevel},</if>
|
|
<if test="serviceLevel != null">#{serviceLevel},</if>
|
|
<if test="serviceCategory != null">#{serviceCategory},</if>
|
|
<if test="serviceCategory != null">#{serviceCategory},</if>
|
|
@@ -270,14 +381,14 @@
|
|
<if test="qualificationImage != null and qualificationImage != ''">#{qualificationImage},</if>
|
|
<if test="qualificationImage != null and qualificationImage != ''">#{qualificationImage},</if>
|
|
<if test="qualificationId != null and qualificationId != ''">#{qualificationId},</if>
|
|
<if test="qualificationId != null and qualificationId != ''">#{qualificationId},</if>
|
|
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
|
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
|
- <if test="updateTime != null">#{updateTime},</if>
|
|
|
|
- <if test="createTime != null">#{createTime},</if>
|
|
|
|
|
|
+ <if test="addTime != null">#{addTime},</if>
|
|
<if test="status != null">#{status},</if>
|
|
<if test="status != null">#{status},</if>
|
|
<if test="userId != null">#{userId},</if>
|
|
<if test="userId != null">#{userId},</if>
|
|
<if test="brandName != null and brandName != ''">#{brandName},</if>
|
|
<if test="brandName != null and brandName != ''">#{brandName},</if>
|
|
<if test="splitCode != null and splitCode != ''">#{splitCode},</if>
|
|
<if test="splitCode != null and splitCode != ''">#{splitCode},</if>
|
|
</trim>
|
|
</trim>
|
|
</insert>
|
|
</insert>
|
|
|
|
+
|
|
<insert id="addProviderProduct">
|
|
<insert id="addProviderProduct">
|
|
INSERT INTO cm_provider_product (providerId, productId)
|
|
INSERT INTO cm_provider_product (providerId, productId)
|
|
VALUES
|
|
VALUES
|
|
@@ -286,15 +397,157 @@
|
|
</foreach>
|
|
</foreach>
|
|
</insert>
|
|
</insert>
|
|
|
|
|
|
- <update id="updateCmProviders" parameterType="CmProviders">
|
|
|
|
- update cm_providers
|
|
|
|
|
|
+ <insert id="addTeam" useGeneratedKeys="true" keyProperty="teamId">
|
|
|
|
+ INSERT INTO cm_serviceteam_role (name, leaderId, createdTime)
|
|
|
|
+ VALUES (#{name}, #{leaderId}, now())
|
|
|
|
+ </insert>
|
|
|
|
+
|
|
|
|
+ <insert id="addGroup">
|
|
|
|
+ INSERT INTO cm_serviceteam_group(teamId, serviceId)
|
|
|
|
+ values
|
|
|
|
+ <foreach collection="spId" item="item" separator=",">
|
|
|
|
+ (#{teamId}, #{item})
|
|
|
|
+ </foreach>
|
|
|
|
+ </insert>
|
|
|
|
+
|
|
|
|
+ <insert id="addTask">
|
|
|
|
+ insert into cm_provider_task(shopId, productId, title, topPic, reward, content, addTime, startTime, endTime)
|
|
|
|
+ values (#{shopId}, #{productId}, #{title}, #{topPic}, #{reward}, #{content}, now(), #{startTime}, #{endTime});
|
|
|
|
+ </insert>
|
|
|
|
+
|
|
|
|
+ <insert id="assignTask">
|
|
|
|
+ INSERT INTO provider_task_role(taskId, serviceProviderId)
|
|
|
|
+ values
|
|
|
|
+ <foreach collection="strToList" item="item" separator=",">
|
|
|
|
+ (#{id}, #{item})
|
|
|
|
+ </foreach>
|
|
|
|
+ </insert>
|
|
|
|
+
|
|
|
|
+ <select id="addGroups" resultType="com.caimei365.manager.entity.caimei.providers.ServiceProviderModel">
|
|
|
|
+ SELECT s.serviceProviderID AS serviceProviderId, s.linkMan as name, s.contractMobile as mobile
|
|
|
|
+ FROM serviceprovider s
|
|
|
|
+ LEFT JOIN cm_serviceTeam_group csg ON csg.serviceId = s.serviceProviderID
|
|
|
|
+ WHERE csg.serviceId is null
|
|
|
|
+ <if test="name !=null and name !=''">
|
|
|
|
+ and s.name like concat('%', #{name}, '%')
|
|
|
|
+ </if>
|
|
|
|
+ <if test="mobile !=null and mobile !=''">
|
|
|
|
+ and s.contractMobile = #{mobile}
|
|
|
|
+ </if>
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+ <select id="taskList" resultType="com.caimei365.manager.entity.caimei.providers.ProviderTask">
|
|
|
|
+ select spt.id,
|
|
|
|
+ spt.shopId,
|
|
|
|
+ spt.productId,
|
|
|
|
+ spt.title,
|
|
|
|
+ spt.addTime,
|
|
|
|
+ spt.startTime,
|
|
|
|
+ spt.endTime,
|
|
|
|
+ spt.reward,
|
|
|
|
+ spt.content,
|
|
|
|
+ s.name as shopName,
|
|
|
|
+ spt.topPic,
|
|
|
|
+ (CASE
|
|
|
|
+ WHEN startTime > NOW() THEN '1'
|
|
|
|
+ WHEN NOW() BETWEEN startTime AND endTime THEN '2'
|
|
|
|
+ WHEN NOW() > endTime THEN '3' END) AS status
|
|
|
|
+ from cm_provider_task spt
|
|
|
|
+ left join shop s on spt.shopId = s.shopId
|
|
|
|
+ <if test="shopName != null and shopName !=''">
|
|
|
|
+ where s.name like concat('%', #{shopName}, '%')
|
|
|
|
+ </if>
|
|
|
|
+ order by addTime desc
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+ <!-- 结果映射 -->
|
|
|
|
+ <resultMap id="providerTasks" type="com.caimei365.manager.entity.caimei.providers.ServiceProviderModel">
|
|
|
|
+
|
|
|
|
+ <result property="serviceProviderId" column="serviceProviderId"/>
|
|
|
|
+ <result property="name" column="name"/>
|
|
|
|
+ <result property="linkMan" column="linkMan"/>
|
|
|
|
+ <result property="userId" column="userId"/>
|
|
|
|
+ <result property="mobile" column="mobile"/>
|
|
|
|
+ <result property="receiveFlag" column="receiveFlag"/>
|
|
|
|
+ <result property="auditStatus" column="auditStatus"/>
|
|
|
|
+ <result property="taskDesc" column="taskDesc"/>
|
|
|
|
+
|
|
|
|
+ <collection property="images" ofType="java.lang.String">
|
|
|
|
+ <result column="image"/>
|
|
|
|
+ </collection>
|
|
|
|
+ </resultMap>
|
|
|
|
+
|
|
|
|
+ <select id="taskProviderList" resultMap="providerTasks">
|
|
|
|
+ select sp.serviceProviderId, sp.name, sp.linkMan, sp.userId, sp.contractMobile as mobile, ptr.receiveFlag,
|
|
|
|
+ ptr.auditStatus,pta.taskDesc,ptai.image
|
|
|
|
+ from serviceprovider sp
|
|
|
|
+ left join provider_task_role ptr on sp.serviceProviderId = ptr.serviceProviderId
|
|
|
|
+ left join provider_task_audit pta on ptr.taskId = pta.taskId
|
|
|
|
+ left join provider_task_audit_image ptai on pta.id = ptai.auditId
|
|
|
|
+ where ptr.taskId = #{taskId}
|
|
|
|
+ <if test="mobile != null and mobile != ''">and sp.contractMobile = #{mobile}</if>
|
|
|
|
+ <if test="name != null and name != ''">and sp.name like concat('%', #{name}, '%')</if>
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+ <select id="providerReceiveList"
|
|
|
|
+ resultType="com.caimei365.manager.entity.caimei.providers.ServiceProviderModel">
|
|
|
|
+ select sp.serviceProviderId, name, linkMan, userId, contractMobile as mobile, ptr.receiveFlag
|
|
|
|
+ from serviceprovider sp
|
|
|
|
+ left join provider_task_role ptr on sp.serviceProviderId = ptr.serviceProviderId AND ptr.taskId = #{taskId}
|
|
|
|
+ WHERE ptr.serviceProviderId IS NULL
|
|
|
|
+ <if test="mobile != null and mobile != ''">and sp.contractMobile = #{mobile}</if>
|
|
|
|
+ <if test="name != null and name != ''">and sp.name like concat('%', #{name}, '%')</if>
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+ <select id="getTaskDetail" resultType="com.caimei365.manager.entity.caimei.providers.ProviderTask">
|
|
|
|
+ select id,
|
|
|
|
+ shopId,
|
|
|
|
+ productId,
|
|
|
|
+ title,
|
|
|
|
+ topPic,
|
|
|
|
+ content,
|
|
|
|
+ reward,
|
|
|
|
+ addTime,
|
|
|
|
+ startTime,
|
|
|
|
+ endTime
|
|
|
|
+ from cm_provider_task
|
|
|
|
+ where id = #{taskId}
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+ <select id="getTaskProducts" resultType="com.caimei365.manager.entity.caimei.product.Product">
|
|
|
|
+ SELECT
|
|
|
|
+ p.productId,
|
|
|
|
+ p.name as productName,
|
|
|
|
+ p.mainImage,
|
|
|
|
+ s.shopId,
|
|
|
|
+ s.name AS shopName
|
|
|
|
+ FROM product p
|
|
|
|
+ LEFT JOIN cm_organize_product_info copi ON copi.productId = p.productId
|
|
|
|
+ LEFT JOIN shop s ON s.shopId = p.shopId
|
|
|
|
+ <where>
|
|
|
|
+ copi.organizeId = 0 AND copi.validFlag = 2
|
|
|
|
+ <if test="productId != null">
|
|
|
|
+ and p.productId = #{productId}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="name != null and name != ''">
|
|
|
|
+ and p.name like concat('%', #{name},'%')
|
|
|
|
+ </if>
|
|
|
|
+ <if test="shopName != null and shopName != ''">
|
|
|
|
+ and s.name like concat('%', #{shopName},'%')
|
|
|
|
+ </if>
|
|
|
|
+ </where>
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+ <update id="updateCmProviders" parameterType="com.caimei365.manager.entity.caimei.providers.ServiceProviderModel">
|
|
|
|
+ update serviceprovider
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
<if test="name != null and name != ''">name = #{name},</if>
|
|
<if test="name != null and name != ''">name = #{name},</if>
|
|
|
|
+ <if test="insiderFlag != null and insiderFlag != ''">insiderFlag = #{insiderFlag},</if>
|
|
<if test="serviceLevel != null">serviceLevel = #{serviceLevel},</if>
|
|
<if test="serviceLevel != null">serviceLevel = #{serviceLevel},</if>
|
|
<if test="serviceCategory != null">serviceCategory = #{serviceCategory},</if>
|
|
<if test="serviceCategory != null">serviceCategory = #{serviceCategory},</if>
|
|
<if test="address != null and address != ''">address = #{address},</if>
|
|
<if test="address != null and address != ''">address = #{address},</if>
|
|
<if test="linkMan != null and linkMan != ''">linkMan = #{linkMan},</if>
|
|
<if test="linkMan != null and linkMan != ''">linkMan = #{linkMan},</if>
|
|
- <if test="mobile != null and mobile != ''">mobile = #{mobile},</if>
|
|
|
|
|
|
+ <if test="mobile != null and mobile != ''">contractMobile = #{mobile},</if>
|
|
<if test="text != null and text != ''">text = #{text},</if>
|
|
<if test="text != null and text != ''">text = #{text},</if>
|
|
<if test="qrCodeImage != null and qrCodeImage != ''">qrCodeImage = #{qrCodeImage},</if>
|
|
<if test="qrCodeImage != null and qrCodeImage != ''">qrCodeImage = #{qrCodeImage},</if>
|
|
<if test="qualificationImage != null and qualificationImage != ''">qualificationImage =
|
|
<if test="qualificationImage != null and qualificationImage != ''">qualificationImage =
|
|
@@ -302,51 +555,92 @@
|
|
</if>
|
|
</if>
|
|
<if test="qualificationId != null and qualificationId != ''">qualificationId = #{qualificationId},</if>
|
|
<if test="qualificationId != null and qualificationId != ''">qualificationId = #{qualificationId},</if>
|
|
<if test="createBy != null and createBy != ''">createBy = #{createBy},</if>
|
|
<if test="createBy != null and createBy != ''">createBy = #{createBy},</if>
|
|
- <if test="updateTime != null">updateTime = #{updateTime},</if>
|
|
|
|
- <if test="createTime != null">createTime = #{createTime},</if>
|
|
|
|
|
|
+ <if test="addTime != null">addTime = #{addTime},</if>
|
|
<if test="status != null">status = #{status},</if>
|
|
<if test="status != null">status = #{status},</if>
|
|
<if test="userId != null">userId = #{userId},</if>
|
|
<if test="userId != null">userId = #{userId},</if>
|
|
<if test="brandName != null and brandName != ''">brandName = #{brandName},</if>
|
|
<if test="brandName != null and brandName != ''">brandName = #{brandName},</if>
|
|
<if test="splitCode != null and splitCode != ''">splitCode = #{splitCode},</if>
|
|
<if test="splitCode != null and splitCode != ''">splitCode = #{splitCode},</if>
|
|
</trim>
|
|
</trim>
|
|
|
|
+ where serviceProviderID = #{serviceProviderId}
|
|
|
|
+ </update>
|
|
|
|
+
|
|
|
|
+ <update id="updatePass">
|
|
|
|
+ update user
|
|
|
|
+ set passWord = #{password}
|
|
|
|
+ where userId = #{userId}
|
|
|
|
+ </update>
|
|
|
|
+
|
|
|
|
+ <update id="updateTeam">
|
|
|
|
+ update cm_serviceteam_role
|
|
|
|
+ set name = #{name}
|
|
|
|
+ where id = #{teamId}
|
|
|
|
+ </update>
|
|
|
|
+
|
|
|
|
+ <update id="updateLeader">
|
|
|
|
+ update cm_serviceteam_role
|
|
|
|
+ set leaderId = #{leaderId}
|
|
|
|
+ where id = ${teamId}
|
|
|
|
+ </update>
|
|
|
|
+
|
|
|
|
+ <update id="updateTask">
|
|
|
|
+ update cm_provider_task
|
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
|
+ <if test="shopId != null and shopId != ''">shopId = #{shopId},</if>
|
|
|
|
+ <if test="productId != null and productId != ''">productId = #{productId},</if>
|
|
|
|
+ <if test="title != null and title != ''">title = #{title},</if>
|
|
|
|
+ <if test="topPic != null and topPic != ''">topPic = #{topPic},</if>
|
|
|
|
+ <if test="reward != null and reward != ''">reward = #{reward},</if>
|
|
|
|
+ <if test="content != null and content != ''">content = #{content},</if>
|
|
|
|
+ <if test="startTime != null">startTime = STR_TO_DATE(#{startTime}, '%Y-%m-%d%H:%i:%s'),</if>
|
|
|
|
+ <if test="endTime != null">endTime = STR_TO_DATE(#{endTime}, '%Y-%m-%d %H:%i:%s'),</if>
|
|
|
|
+ </trim>
|
|
where id = #{id}
|
|
where id = #{id}
|
|
- <if test="userId != null">or userId = #{userId}</if>
|
|
|
|
|
|
+ </update>
|
|
|
|
+
|
|
|
|
+ <update id="auditTask">
|
|
|
|
+ update provider_task_role
|
|
|
|
+ set auditStatus = #{auditStatus}
|
|
|
|
+ where taskId = #{taskId}
|
|
|
|
+ and serviceProviderId = #{serviceProviderId}
|
|
</update>
|
|
</update>
|
|
|
|
|
|
<delete id="delCmProvidersById" parameterType="String">
|
|
<delete id="delCmProvidersById" parameterType="String">
|
|
delete
|
|
delete
|
|
- from cm_providers
|
|
|
|
|
|
+ from serviceprovider
|
|
|
|
+ where serviceProviderID = #{serviceProviderId}
|
|
|
|
+ </delete>
|
|
|
|
+
|
|
|
|
+ <delete id="delProviderProduct">
|
|
|
|
+ delete
|
|
|
|
+ from cm_provider_product
|
|
|
|
+ where productId = #{productId}
|
|
|
|
+ and providerId = #{providerId}
|
|
|
|
+ </delete>
|
|
|
|
+
|
|
|
|
+ <delete id="delTeam">
|
|
|
|
+ delete
|
|
|
|
+ from cm_serviceteam_role
|
|
where id = #{id}
|
|
where id = #{id}
|
|
</delete>
|
|
</delete>
|
|
|
|
|
|
- <delete id="delCmProviders" parameterType="CmProviders">
|
|
|
|
|
|
+ <delete id="delTeamGroup">
|
|
delete
|
|
delete
|
|
- from cm_providers AS cm_providers
|
|
|
|
- <where>
|
|
|
|
- <if test="id != null and id != ''">and cm_providers.id = #{id}</if>
|
|
|
|
- <if test="name != null and name != ''">and cm_providers.name like concat('%', #{name}, '%')</if>
|
|
|
|
- <if test="serviceLevel != null ">and cm_providers.serviceLevel = #{serviceLevel}</if>
|
|
|
|
- <if test="serviceCategory != null ">and cm_providers.serviceCategory = #{serviceCategory}</if>
|
|
|
|
- <if test="status != null ">and cm_providers.status = #{status}</if>
|
|
|
|
- <if test="userId != null ">and cm_providers.userId = #{userId}</if>
|
|
|
|
- <if test="address != null and address != ''">and cm_providers.address = #{address}</if>
|
|
|
|
- <if test="linkMan != null and linkMan != ''">and cm_providers.linkMan = #{linkMan}</if>
|
|
|
|
- <if test="mobile != null and mobile != ''">and cm_providers.mobile = #{mobile}</if>
|
|
|
|
- <if test="text != null and text != ''">and cm_providers.text = #{text}</if>
|
|
|
|
- <if test="qrCodeImage != null and qrCodeImage != ''">and cm_providers.qrCodeImage = #{qrCodeImage}</if>
|
|
|
|
- <if test="qualificationImage != null and qualificationImage != ''">and cm_providers.qualificationImage =
|
|
|
|
- #{qualificationImage}
|
|
|
|
- </if>
|
|
|
|
- <if test="qualificationId != null and qualificationId != ''">and cm_providers.qualificationId =
|
|
|
|
- #{qualificationId}
|
|
|
|
- </if>
|
|
|
|
- </where>
|
|
|
|
|
|
+ from cm_serviceteam_group
|
|
|
|
+ where teamId = #{id}
|
|
</delete>
|
|
</delete>
|
|
|
|
|
|
- <delete id="delProviderProduct">
|
|
|
|
- delete from cm_provider_product
|
|
|
|
- where productId = #{productId}
|
|
|
|
- and providerId = #{providerId}
|
|
|
|
|
|
+ <delete id="delGroup">
|
|
|
|
+ delete
|
|
|
|
+ from cm_serviceteam_group
|
|
|
|
+ where teamId = #{teamId}
|
|
|
|
+ and serviceId = #{spId}
|
|
|
|
+ </delete>
|
|
|
|
+
|
|
|
|
+ <delete id="taskProviderDel">
|
|
|
|
+ delete
|
|
|
|
+ from provider_task_role
|
|
|
|
+ where serviceProviderId = #{serviceProviderId}
|
|
|
|
+ and taskId = #{taskId}
|
|
</delete>
|
|
</delete>
|
|
|
|
|
|
</mapper>
|
|
</mapper>
|