|
@@ -2,8 +2,8 @@
|
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
<mapper namespace="com.caimei.modules.user.dao.NewCmClubDao">
|
|
|
|
|
|
- <sql id="newCmClubColumns">
|
|
|
- a.checkMan as "checkMan",
|
|
|
+ <sql id="newCmClubColumns">
|
|
|
+ a.checkMan as "checkMan",
|
|
|
a.clubID AS "clubID",
|
|
|
a.userID AS "userID",
|
|
|
u.name AS "name",
|
|
@@ -43,10 +43,10 @@
|
|
|
a.secondClubType AS "secondClubType",
|
|
|
a.department AS "department",
|
|
|
a.medicalPracticeLicenseImg AS "medicalPracticeLicenseImg"
|
|
|
- </sql>
|
|
|
+ </sql>
|
|
|
|
|
|
- <sql id="otherColumns">
|
|
|
- ,case sp.status when 91 then '采美默认协销经理(官方账号)' else sp.linkMan end AS "spName",
|
|
|
+ <sql id="otherColumns">
|
|
|
+ ,case sp.status when 91 then '采美默认协销经理(官方账号)' else sp.linkMan end AS "spName",
|
|
|
d.name AS "province",
|
|
|
c.name AS "city",
|
|
|
b.name AS "town",
|
|
@@ -59,442 +59,457 @@
|
|
|
u.userOrganizeID AS "userOrganizeID",
|
|
|
u.userIdentity AS "userIdentity",
|
|
|
if(csu.delFlag = '0' and now() <![CDATA[ < ]]> csu.endTime,1,0) as svipUserFlag
|
|
|
- </sql>
|
|
|
+ </sql>
|
|
|
|
|
|
- <sql id="newCmClubJoins">
|
|
|
- LEFT JOIN user u ON u.userID = a.userID
|
|
|
+ <sql id="newCmClubJoins">
|
|
|
+ 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=b.cityID
|
|
|
LEFT JOIN province d ON d.provinceID=c.provinceID
|
|
|
- </sql>
|
|
|
+ </sql>
|
|
|
|
|
|
- <select id="get" resultType="NewCmClub">
|
|
|
- SELECT
|
|
|
- <include refid="newCmClubColumns"/>
|
|
|
- <include refid="otherColumns"/>
|
|
|
- FROM club a
|
|
|
- <include refid="newCmClubJoins"/>
|
|
|
- WHERE a.clubID = #{id}
|
|
|
- </select>
|
|
|
+ <select id="get" resultType="NewCmClub">
|
|
|
+ SELECT
|
|
|
+ <include refid="newCmClubColumns"/>
|
|
|
+ <include refid="otherColumns"/>
|
|
|
+ FROM club a
|
|
|
+ <include refid="newCmClubJoins"/>
|
|
|
+ WHERE a.clubID = #{id}
|
|
|
+ </select>
|
|
|
|
|
|
- <select id="getclubByUserId" resultType="NewCmClub">
|
|
|
- SELECT
|
|
|
- <include refid="newCmClubColumns"/>
|
|
|
- FROM club a
|
|
|
- <include refid="newCmClubJoins"/>
|
|
|
- WHERE a.userID = #{userID}
|
|
|
- </select>
|
|
|
+ <select id="getclubByUserId" resultType="NewCmClub">
|
|
|
+ SELECT
|
|
|
+ <include refid="newCmClubColumns"/>
|
|
|
+ FROM club a
|
|
|
+ <include refid="newCmClubJoins"/>
|
|
|
+ WHERE a.userID = #{userID}
|
|
|
+ </select>
|
|
|
|
|
|
|
|
|
+ <select id="findList" resultType="NewCmClub">
|
|
|
+ SELECT
|
|
|
+ <include refid="newCmClubColumns"/>
|
|
|
+ <include refid="otherColumns"/>,u.userPermission,u.source
|
|
|
+ FROM club a
|
|
|
+ <include refid="newCmClubJoins"/>
|
|
|
+ <where>
|
|
|
+ <if test="clubID != null and clubID != ''">
|
|
|
+ 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="email != null and email != ''">
|
|
|
+ AND u.email LIKE concat('%',#{email},'%')
|
|
|
+ </if>
|
|
|
+ <if test="linkMan != null and linkMan != ''">
|
|
|
+ AND a.linkMan LIKE concat('%',#{linkMan},'%')
|
|
|
+ </if>
|
|
|
+ <if test="startTime != null and startTime != ''">
|
|
|
+ AND (u.registerTime > #{startTime} OR u.registerTime = #{startTime})
|
|
|
+ </if>
|
|
|
+ <if test="endTime != null and endTime != ''">
|
|
|
+ AND (u.registerTime < #{endTime} OR u.registerTime = #{endTime})
|
|
|
+ </if>
|
|
|
+ <if test="userIdentity != null and userIdentity != '' and userIdentity != '8'.toString()">
|
|
|
+ AND u.userIdentity = #{userIdentity}
|
|
|
+ </if>
|
|
|
+ <if test="userIdentity != null and userIdentity != '' and userIdentity == '8'.toString()">
|
|
|
+ AND csu.delFlag = '0' and now() <![CDATA[ < ]]> csu.endTime
|
|
|
+ </if>
|
|
|
+ AND (u.userOrganizeID IN(0,1) or u.clubStatus != 92)
|
|
|
+ </where>
|
|
|
+ <choose>
|
|
|
+ <when test="page !=null and page.orderBy != null and page.orderBy != ''">
|
|
|
+ ORDER BY ${page.orderBy}
|
|
|
+ </when>
|
|
|
+ <otherwise>
|
|
|
+ ORDER BY case when a.status = 91 then 0 else 1 end desc, a.addTime DESC
|
|
|
+ </otherwise>
|
|
|
+ </choose>
|
|
|
+ </select>
|
|
|
|
|
|
- <select id="findList" resultType="NewCmClub">
|
|
|
- SELECT
|
|
|
- <include refid="newCmClubColumns"/>
|
|
|
- <include refid="otherColumns"/>,u.userPermission,u.source
|
|
|
- FROM club a
|
|
|
- <include refid="newCmClubJoins"/>
|
|
|
- <where>
|
|
|
- <if test="clubID != null and clubID != ''">
|
|
|
- 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="email != null and email != ''">
|
|
|
- AND u.email LIKE concat('%',#{email},'%')
|
|
|
- </if>
|
|
|
- <if test="linkMan != null and linkMan != ''">
|
|
|
- AND a.linkMan LIKE concat('%',#{linkMan},'%')
|
|
|
- </if>
|
|
|
- <if test="startTime != null and startTime != ''">
|
|
|
- AND (u.registerTime > #{startTime} OR u.registerTime = #{startTime})
|
|
|
- </if>
|
|
|
- <if test="endTime != null and endTime != ''">
|
|
|
- AND (u.registerTime < #{endTime} OR u.registerTime = #{endTime})
|
|
|
- </if>
|
|
|
- <if test="userIdentity != null and userIdentity != '' and userIdentity != '8'.toString()">
|
|
|
- AND u.userIdentity = #{userIdentity}
|
|
|
- </if>
|
|
|
- <if test="userIdentity != null and userIdentity != '' and userIdentity == '8'.toString()">
|
|
|
- AND csu.delFlag = '0' and now() <![CDATA[ < ]]> csu.endTime
|
|
|
- </if>
|
|
|
- AND (u.userOrganizeID IN(0,1) or u.clubStatus != 92)
|
|
|
- </where>
|
|
|
- <choose>
|
|
|
- <when test="page !=null and page.orderBy != null and page.orderBy != ''">
|
|
|
- ORDER BY ${page.orderBy}
|
|
|
- </when>
|
|
|
- <otherwise>
|
|
|
- ORDER BY case when a.status = 91 then 0 else 1 end desc, a.addTime DESC
|
|
|
- </otherwise>
|
|
|
- </choose>
|
|
|
- </select>
|
|
|
+ <select id="findAllList" resultType="NewCmClub">
|
|
|
+ SELECT
|
|
|
+ <include refid="newCmClubColumns"/>
|
|
|
+ <include refid="otherColumns"/>
|
|
|
+ FROM club a
|
|
|
+ <include refid="newCmClubJoins"/>
|
|
|
+ <where>
|
|
|
|
|
|
- <select id="findAllList" resultType="NewCmClub">
|
|
|
- SELECT
|
|
|
- <include refid="newCmClubColumns"/>
|
|
|
- <include refid="otherColumns"/>
|
|
|
- FROM club a
|
|
|
- <include refid="newCmClubJoins"/>
|
|
|
- <where>
|
|
|
|
|
|
+ </where>
|
|
|
+ <choose>
|
|
|
+ <when test="page !=null and page.orderBy != null and page.orderBy != ''">
|
|
|
+ ORDER BY ${page.orderBy}
|
|
|
+ </when>
|
|
|
+ <otherwise>
|
|
|
+ </otherwise>
|
|
|
+ </choose>
|
|
|
+ </select>
|
|
|
|
|
|
-</where>
|
|
|
- <choose>
|
|
|
- <when test="page !=null and page.orderBy != null and page.orderBy != ''">
|
|
|
- ORDER BY ${page.orderBy}
|
|
|
- </when>
|
|
|
- <otherwise>
|
|
|
- </otherwise>
|
|
|
- </choose>
|
|
|
- </select>
|
|
|
-
|
|
|
- <insert id="insert" parameterType="NewCmClub" keyProperty="clubID" useGeneratedKeys="true">
|
|
|
- INSERT INTO club(
|
|
|
- userID,
|
|
|
- name,
|
|
|
- sname,
|
|
|
- logo,
|
|
|
- legalPerson,
|
|
|
- provinceID,
|
|
|
- cityID,
|
|
|
- townID,
|
|
|
- flag,
|
|
|
- inviterBindID,
|
|
|
- inviterName,
|
|
|
- spID,
|
|
|
- mainServiceProviderID,
|
|
|
- scanTime,
|
|
|
- address,
|
|
|
- linkMan,
|
|
|
- linkManIdentity,
|
|
|
- contractPhone,
|
|
|
- contractMobile,
|
|
|
- contractEmail,
|
|
|
- fax,
|
|
|
- info,
|
|
|
- addTime,
|
|
|
- auditTime,
|
|
|
- auditNote,
|
|
|
- status,
|
|
|
- businessLicenseImage,
|
|
|
- defaultServiceProviderID,
|
|
|
- defaultServiceProviderUpdTime,
|
|
|
- mainpro,
|
|
|
- scanFlag,
|
|
|
- headpic,
|
|
|
- lastModify,
|
|
|
- firstClubType,
|
|
|
- socialCreditCode,
|
|
|
- secondClubType,
|
|
|
- department,
|
|
|
- medicalPracticeLicenseImg
|
|
|
- ) VALUES (
|
|
|
- #{userID},
|
|
|
- #{name},
|
|
|
- #{sname},
|
|
|
- #{logo},
|
|
|
- #{legalPerson},
|
|
|
- #{provinceID},
|
|
|
- #{cityID},
|
|
|
- #{townID},
|
|
|
- #{flag},
|
|
|
- #{inviterBindID},
|
|
|
- #{inviterName},
|
|
|
- #{spID},
|
|
|
- #{mainServiceProviderID},
|
|
|
- #{scanTime},
|
|
|
- #{address},
|
|
|
- #{linkMan},
|
|
|
- #{linkManIdentity},
|
|
|
- #{contractPhone},
|
|
|
- #{contractMobile},
|
|
|
- #{contractEmail},
|
|
|
- #{fax},
|
|
|
- #{info},
|
|
|
- #{addTime},
|
|
|
- #{auditTime},
|
|
|
- #{auditNote},
|
|
|
- #{status},
|
|
|
- #{businessLicenseImage},
|
|
|
- #{defaultServiceProviderID},
|
|
|
- #{defaultServiceProviderUpdTime},
|
|
|
- #{mainpro},
|
|
|
- #{scanFlag},
|
|
|
- #{headpic},
|
|
|
- #{lastModify},
|
|
|
- #{firstClubType},
|
|
|
- #{socialCreditCode},
|
|
|
- #{secondClubType},
|
|
|
- #{department},
|
|
|
- #{medicalPracticeLicenseImg}
|
|
|
- )
|
|
|
- </insert>
|
|
|
+ <insert id="insert" parameterType="NewCmClub" keyProperty="clubID" useGeneratedKeys="true">
|
|
|
+ INSERT INTO club(userID,
|
|
|
+ name,
|
|
|
+ sname,
|
|
|
+ logo,
|
|
|
+ legalPerson,
|
|
|
+ provinceID,
|
|
|
+ cityID,
|
|
|
+ townID,
|
|
|
+ flag,
|
|
|
+ inviterBindID,
|
|
|
+ inviterName,
|
|
|
+ spID,
|
|
|
+ mainServiceProviderID,
|
|
|
+ scanTime,
|
|
|
+ address,
|
|
|
+ linkMan,
|
|
|
+ linkManIdentity,
|
|
|
+ contractPhone,
|
|
|
+ contractMobile,
|
|
|
+ contractEmail,
|
|
|
+ fax,
|
|
|
+ info,
|
|
|
+ addTime,
|
|
|
+ auditTime,
|
|
|
+ auditNote,
|
|
|
+ status,
|
|
|
+ businessLicenseImage,
|
|
|
+ defaultServiceProviderID,
|
|
|
+ defaultServiceProviderUpdTime,
|
|
|
+ mainpro,
|
|
|
+ scanFlag,
|
|
|
+ headpic,
|
|
|
+ lastModify,
|
|
|
+ firstClubType,
|
|
|
+ socialCreditCode,
|
|
|
+ secondClubType,
|
|
|
+ department,
|
|
|
+ medicalPracticeLicenseImg)
|
|
|
+ VALUES (#{userID},
|
|
|
+ #{name},
|
|
|
+ #{sname},
|
|
|
+ #{logo},
|
|
|
+ #{legalPerson},
|
|
|
+ #{provinceID},
|
|
|
+ #{cityID},
|
|
|
+ #{townID},
|
|
|
+ #{flag},
|
|
|
+ #{inviterBindID},
|
|
|
+ #{inviterName},
|
|
|
+ #{spID},
|
|
|
+ #{mainServiceProviderID},
|
|
|
+ #{scanTime},
|
|
|
+ #{address},
|
|
|
+ #{linkMan},
|
|
|
+ #{linkManIdentity},
|
|
|
+ #{contractPhone},
|
|
|
+ #{contractMobile},
|
|
|
+ #{contractEmail},
|
|
|
+ #{fax},
|
|
|
+ #{info},
|
|
|
+ #{addTime},
|
|
|
+ #{auditTime},
|
|
|
+ #{auditNote},
|
|
|
+ #{status},
|
|
|
+ #{businessLicenseImage},
|
|
|
+ #{defaultServiceProviderID},
|
|
|
+ #{defaultServiceProviderUpdTime},
|
|
|
+ #{mainpro},
|
|
|
+ #{scanFlag},
|
|
|
+ #{headpic},
|
|
|
+ #{lastModify},
|
|
|
+ #{firstClubType},
|
|
|
+ #{socialCreditCode},
|
|
|
+ #{secondClubType},
|
|
|
+ #{department},
|
|
|
+ #{medicalPracticeLicenseImg})
|
|
|
+ </insert>
|
|
|
|
|
|
- <update id="update">
|
|
|
- UPDATE club SET
|
|
|
- <if test="checkMan != null and checkMan != ''">
|
|
|
- checkMan = #{checkMan},
|
|
|
- </if>
|
|
|
- <if test="name != null and name != ''">
|
|
|
- name = #{name},
|
|
|
- </if>
|
|
|
- <if test="sname != null">
|
|
|
- sname = #{sname},
|
|
|
- </if>
|
|
|
- <if test="logo != null and logo != ''">
|
|
|
- logo = #{logo},
|
|
|
- </if>
|
|
|
- <if test="legalPerson != null and legalPerson != ''">
|
|
|
- legalPerson = #{legalPerson},
|
|
|
- </if>
|
|
|
- <if test="provinceID != null and provinceID != ''">
|
|
|
- provinceID = #{provinceID},
|
|
|
- </if>
|
|
|
- <if test="cityID != null and cityID != ''">
|
|
|
- cityID = #{cityID},
|
|
|
- </if>
|
|
|
- <if test="townID != null and townID != ''">
|
|
|
- townID = #{townID},
|
|
|
- </if>
|
|
|
- <if test="flag != null and flag != ''">
|
|
|
- flag = #{flag},
|
|
|
- </if>
|
|
|
- <if test="inviterBindID != null and inviterBindID != ''">
|
|
|
- inviterBindID = #{inviterBindID},
|
|
|
- </if>
|
|
|
- <if test="inviterName != null and inviterName != ''">
|
|
|
- inviterName = #{inviterName},
|
|
|
- </if>
|
|
|
- <if test="spID != null and spID != ''">
|
|
|
- spID = #{spID},
|
|
|
- </if>
|
|
|
- <if test="mainServiceProviderID != null and mainServiceProviderID != ''">
|
|
|
- mainServiceProviderID = #{mainServiceProviderID},
|
|
|
- </if>
|
|
|
- <if test="scanTime != null">
|
|
|
- scanTime = #{scanTime},
|
|
|
- </if>
|
|
|
- <if test="address != null and address != ''">
|
|
|
- address = #{address},
|
|
|
- </if>
|
|
|
- <if test="linkMan != null and linkMan != ''">
|
|
|
- linkMan = #{linkMan},
|
|
|
- </if>
|
|
|
- <if test="linkManIdentity != null and linkManIdentity != ''">
|
|
|
- linkManIdentity = #{linkManIdentity},
|
|
|
- </if>
|
|
|
- <if test="contractPhone != null and contractPhone != ''">
|
|
|
- contractPhone = #{contractPhone},
|
|
|
- </if>
|
|
|
- <if test="contractMobile != null and contractMobile != ''">
|
|
|
- contractMobile = #{contractMobile},
|
|
|
- </if>
|
|
|
- <if test="contractEmail != null and contractEmail != ''">
|
|
|
- contractEmail = #{contractEmail},
|
|
|
- </if>
|
|
|
- <if test="fax != null and fax != ''">
|
|
|
- fax = #{fax},
|
|
|
- </if>
|
|
|
- <if test="info != null and info != ''">
|
|
|
- info = #{info},
|
|
|
- </if>
|
|
|
- <if test="addTime != null">
|
|
|
- addTime = #{addTime},
|
|
|
- </if>
|
|
|
- <if test="auditTime != null">
|
|
|
- auditTime = #{auditTime},
|
|
|
- </if>
|
|
|
- <if test="auditNote != null and auditNote != ''">
|
|
|
- auditNote = #{auditNote},
|
|
|
- </if>
|
|
|
- <if test="status != null and status != ''">
|
|
|
- status = #{status},
|
|
|
- </if>
|
|
|
- <if test="businessLicenseImage != null">
|
|
|
- businessLicenseImage = #{businessLicenseImage},
|
|
|
- </if>
|
|
|
- <if test="socialCreditCode != null and socialCreditCode != ''">
|
|
|
- socialCreditCode = #{socialCreditCode},
|
|
|
- </if>
|
|
|
- <if test="defaultServiceProviderID != null and defaultServiceProviderID != ''">
|
|
|
- defaultServiceProviderID = #{defaultServiceProviderID},
|
|
|
- </if>
|
|
|
- <if test="defaultServiceProviderUpdTime != null and defaultServiceProviderUpdTime != ''">
|
|
|
- defaultServiceProviderUpdTime = #{defaultServiceProviderUpdTime},
|
|
|
- </if>
|
|
|
- <if test="mainpro != null and mainpro != ''">
|
|
|
- mainpro = #{mainpro},
|
|
|
- </if>
|
|
|
- <if test="scanFlag != null and scanFlag != ''">
|
|
|
- scanFlag = #{scanFlag},
|
|
|
- </if>
|
|
|
- <if test="headpic != null">
|
|
|
- headpic = #{headpic},
|
|
|
- </if>
|
|
|
- <if test="lastModify != null and lastModify != ''">
|
|
|
- lastModify = DATE_FORMAT(#{lastModify},'%Y-%m-%d %H:%i:%s'),
|
|
|
- </if>
|
|
|
- <if test="firstClubType != null and firstClubType != ''">
|
|
|
- firstClubType=#{firstClubType},
|
|
|
- </if>
|
|
|
- <if test="secondClubType != null and secondClubType != ''">
|
|
|
- secondClubType=#{secondClubType},
|
|
|
- </if>
|
|
|
- <if test="department != null and department != ''">
|
|
|
- department=#{department},
|
|
|
- </if>
|
|
|
- <if test="medicalPracticeLicenseImg != null and medicalPracticeLicenseImg != ''">
|
|
|
- medicalPracticeLicenseImg=#{medicalPracticeLicenseImg},
|
|
|
- </if>
|
|
|
- userID = #{userID}
|
|
|
- WHERE clubID = #{clubID}
|
|
|
- </update>
|
|
|
+ <update id="update">
|
|
|
+ UPDATE club SET
|
|
|
+ <if test="checkMan != null and checkMan != ''">
|
|
|
+ checkMan = #{checkMan},
|
|
|
+ </if>
|
|
|
+ <if test="name != null and name != ''">
|
|
|
+ name = #{name},
|
|
|
+ </if>
|
|
|
+ <if test="sname != null">
|
|
|
+ sname = #{sname},
|
|
|
+ </if>
|
|
|
+ <if test="logo != null and logo != ''">
|
|
|
+ logo = #{logo},
|
|
|
+ </if>
|
|
|
+ <if test="legalPerson != null and legalPerson != ''">
|
|
|
+ legalPerson = #{legalPerson},
|
|
|
+ </if>
|
|
|
+ <if test="provinceID != null and provinceID != ''">
|
|
|
+ provinceID = #{provinceID},
|
|
|
+ </if>
|
|
|
+ <if test="cityID != null and cityID != ''">
|
|
|
+ cityID = #{cityID},
|
|
|
+ </if>
|
|
|
+ <if test="townID != null and townID != ''">
|
|
|
+ townID = #{townID},
|
|
|
+ </if>
|
|
|
+ <if test="flag != null and flag != ''">
|
|
|
+ flag = #{flag},
|
|
|
+ </if>
|
|
|
+ <if test="inviterBindID != null and inviterBindID != ''">
|
|
|
+ inviterBindID = #{inviterBindID},
|
|
|
+ </if>
|
|
|
+ <if test="inviterName != null and inviterName != ''">
|
|
|
+ inviterName = #{inviterName},
|
|
|
+ </if>
|
|
|
+ <if test="spID != null and spID != ''">
|
|
|
+ spID = #{spID},
|
|
|
+ </if>
|
|
|
+ <if test="mainServiceProviderID != null and mainServiceProviderID != ''">
|
|
|
+ mainServiceProviderID = #{mainServiceProviderID},
|
|
|
+ </if>
|
|
|
+ <if test="scanTime != null">
|
|
|
+ scanTime = #{scanTime},
|
|
|
+ </if>
|
|
|
+ <if test="address != null and address != ''">
|
|
|
+ address = #{address},
|
|
|
+ </if>
|
|
|
+ <if test="linkMan != null and linkMan != ''">
|
|
|
+ linkMan = #{linkMan},
|
|
|
+ </if>
|
|
|
+ <if test="linkManIdentity != null and linkManIdentity != ''">
|
|
|
+ linkManIdentity = #{linkManIdentity},
|
|
|
+ </if>
|
|
|
+ <if test="contractPhone != null and contractPhone != ''">
|
|
|
+ contractPhone = #{contractPhone},
|
|
|
+ </if>
|
|
|
+ <if test="contractMobile != null and contractMobile != ''">
|
|
|
+ contractMobile = #{contractMobile},
|
|
|
+ </if>
|
|
|
+ <if test="contractEmail != null and contractEmail != ''">
|
|
|
+ contractEmail = #{contractEmail},
|
|
|
+ </if>
|
|
|
+ <if test="fax != null and fax != ''">
|
|
|
+ fax = #{fax},
|
|
|
+ </if>
|
|
|
+ <if test="info != null and info != ''">
|
|
|
+ info = #{info},
|
|
|
+ </if>
|
|
|
+ <if test="addTime != null">
|
|
|
+ addTime = #{addTime},
|
|
|
+ </if>
|
|
|
+ <if test="auditTime != null">
|
|
|
+ auditTime = #{auditTime},
|
|
|
+ </if>
|
|
|
+ <if test="auditNote != null and auditNote != ''">
|
|
|
+ auditNote = #{auditNote},
|
|
|
+ </if>
|
|
|
+ <if test="status != null and status != ''">
|
|
|
+ status = #{status},
|
|
|
+ </if>
|
|
|
+ <if test="businessLicenseImage != null">
|
|
|
+ businessLicenseImage = #{businessLicenseImage},
|
|
|
+ </if>
|
|
|
+ <if test="socialCreditCode != null and socialCreditCode != ''">
|
|
|
+ socialCreditCode = #{socialCreditCode},
|
|
|
+ </if>
|
|
|
+ <if test="defaultServiceProviderID != null and defaultServiceProviderID != ''">
|
|
|
+ defaultServiceProviderID = #{defaultServiceProviderID},
|
|
|
+ </if>
|
|
|
+ <if test="defaultServiceProviderUpdTime != null and defaultServiceProviderUpdTime != ''">
|
|
|
+ defaultServiceProviderUpdTime = #{defaultServiceProviderUpdTime},
|
|
|
+ </if>
|
|
|
+ <if test="mainpro != null and mainpro != ''">
|
|
|
+ mainpro = #{mainpro},
|
|
|
+ </if>
|
|
|
+ <if test="scanFlag != null and scanFlag != ''">
|
|
|
+ scanFlag = #{scanFlag},
|
|
|
+ </if>
|
|
|
+ <if test="headpic != null">
|
|
|
+ headpic = #{headpic},
|
|
|
+ </if>
|
|
|
+ <if test="lastModify != null and lastModify != ''">
|
|
|
+ lastModify = DATE_FORMAT(#{lastModify},'%Y-%m-%d %H:%i:%s'),
|
|
|
+ </if>
|
|
|
+ <if test="firstClubType != null and firstClubType != ''">
|
|
|
+ firstClubType=#{firstClubType},
|
|
|
+ </if>
|
|
|
+ <if test="secondClubType != null and secondClubType != ''">
|
|
|
+ secondClubType=#{secondClubType},
|
|
|
+ </if>
|
|
|
+ <if test="department != null and department != ''">
|
|
|
+ department=#{department},
|
|
|
+ </if>
|
|
|
+ <if test="medicalPracticeLicenseImg != null and medicalPracticeLicenseImg != ''">
|
|
|
+ medicalPracticeLicenseImg=#{medicalPracticeLicenseImg},
|
|
|
+ </if>
|
|
|
+ userID = #{userID}
|
|
|
+ WHERE clubID = #{clubID}
|
|
|
+ </update>
|
|
|
|
|
|
- <delete id="delete">
|
|
|
- DELETE FROM club
|
|
|
- WHERE clubID = #{clubID}
|
|
|
- </delete>
|
|
|
+ <delete id="delete">
|
|
|
+ DELETE
|
|
|
+ FROM club
|
|
|
+ WHERE clubID = #{clubID}
|
|
|
+ </delete>
|
|
|
|
|
|
- <select id="findClubById" resultType="NewCmClub">
|
|
|
- SELECT
|
|
|
- <include refid="newCmClubColumns"/>
|
|
|
- , CONCAT(d.name,c.name ,b.name ,a.`address` ) address
|
|
|
- FROM club a
|
|
|
- LEFT JOIN user u ON u.userID = a.userID
|
|
|
- LEFT JOIN town b ON a.townID =b.townID
|
|
|
- LEFT JOIN city c ON b.cityID=c.cityID
|
|
|
- JOIN province d ON c.`provinceID` =d.`provinceID`
|
|
|
- WHERE a.clubID=#{clubID}
|
|
|
- </select>
|
|
|
+ <select id="findClubById" resultType="NewCmClub">
|
|
|
+ SELECT
|
|
|
+ <include refid="newCmClubColumns"/>
|
|
|
+ , CONCAT(d.name,c.name ,b.name ,a.`address` ) address
|
|
|
+ FROM club a
|
|
|
+ LEFT JOIN user u ON u.userID = a.userID
|
|
|
+ LEFT JOIN town b ON a.townID =b.townID
|
|
|
+ LEFT JOIN city c ON b.cityID=c.cityID
|
|
|
+ JOIN province d ON c.`provinceID` =d.`provinceID`
|
|
|
+ WHERE a.clubID=#{clubID}
|
|
|
+ </select>
|
|
|
|
|
|
- <select id="findSpId" resultType="java.lang.Integer">
|
|
|
- select serviceProviderID from serviceprovider where serviceProviderID = #{spID} and status = 90
|
|
|
- </select>
|
|
|
+ <select id="findSpId" resultType="java.lang.Integer">
|
|
|
+ select serviceProviderID
|
|
|
+ from serviceprovider
|
|
|
+ where serviceProviderID = #{spID}
|
|
|
+ and status = 90
|
|
|
+ </select>
|
|
|
<select id="findRemarksList" resultType="com.caimei.modules.user.entity.CmClubRemarks">
|
|
|
- select DISTINCT
|
|
|
- ccr.id as remarksId, remarks,s.linkMan as spName, ccr.addTime,ccr.questionMan,ccr.consultType as consult,
|
|
|
- (SELECT NAME FROM serviceprovider s WHERE s.serviceProviderID = csr.leaderId) AS leaderName
|
|
|
- from cm_club_remarks ccr
|
|
|
- left join serviceprovider s on ccr.serviceProviderId = s.serviceProviderID
|
|
|
- LEFT JOIN cm_serviceteam_group csg ON ccr.serviceProviderId=csg.serviceId
|
|
|
- LEFT JOIN cm_serviceteam_role csr ON csr.id = csg.teamId
|
|
|
- where clubId = #{clubId}
|
|
|
- order by addTime desc
|
|
|
- </select>
|
|
|
- <select id="getRemarksImageList" resultType="java.lang.String">
|
|
|
- select imageUrl
|
|
|
- from cm_club_remarks_file
|
|
|
- where remarksId = #{remarksId}
|
|
|
- and fileType = 1
|
|
|
- </select>
|
|
|
- <select id="getRemarksFileList" resultType="com.caimei.modules.user.entity.RemarksFileVo">
|
|
|
- select fileName, ossName
|
|
|
- from cm_club_remarks_file
|
|
|
- where remarksId = #{remarksId}
|
|
|
- and fileType = 2
|
|
|
- </select>
|
|
|
+ select DISTINCT ccr.id as remarksId,
|
|
|
+ remarks,
|
|
|
+ s.linkMan as spName,
|
|
|
+ ccr.addTime,
|
|
|
+ ccr.questionMan,
|
|
|
+ ccr.consultType as consult,
|
|
|
+ (SELECT NAME FROM serviceprovider s WHERE s.serviceProviderID = csr.leaderId) AS leaderName
|
|
|
+ from cm_club_remarks ccr
|
|
|
+ left join serviceprovider s on ccr.serviceProviderId = s.serviceProviderID
|
|
|
+ LEFT JOIN cm_serviceteam_group csg ON ccr.serviceProviderId = csg.serviceId
|
|
|
+ LEFT JOIN cm_serviceteam_role csr ON csr.id = csg.teamId
|
|
|
+ where clubId = #{clubId}
|
|
|
+ order by addTime desc
|
|
|
+ </select>
|
|
|
+ <select id="getRemarksImageList" resultType="java.lang.String">
|
|
|
+ select imageUrl
|
|
|
+ from cm_club_remarks_file
|
|
|
+ where remarksId = #{remarksId}
|
|
|
+ and fileType = 1
|
|
|
+ </select>
|
|
|
+ <select id="getRemarksFileList" resultType="com.caimei.modules.user.entity.RemarksFileVo">
|
|
|
+ select fileName, ossName
|
|
|
+ from cm_club_remarks_file
|
|
|
+ where remarksId = #{remarksId}
|
|
|
+ and fileType = 2
|
|
|
+ </select>
|
|
|
|
|
|
<insert id="insertBeansHistory">
|
|
|
- INSERT INTO `user_beans_history` (
|
|
|
- `userId`, `type`, `beansType`, `orderId`,
|
|
|
- `num`, `pushStatus`, `addTime`, delFlag
|
|
|
- )
|
|
|
- VALUES
|
|
|
- (
|
|
|
- #{userId}, #{type}, #{beansType}, #{orderId},
|
|
|
- #{num}, #{pushStatus}, #{addTime}, 0
|
|
|
- )
|
|
|
+ INSERT INTO `user_beans_history` (`userId`, `type`, `beansType`, `orderId`,
|
|
|
+ `num`, `pushStatus`, `addTime`, delFlag)
|
|
|
+ VALUES (#{userId}, #{type}, #{beansType}, #{orderId},
|
|
|
+ #{num}, #{pushStatus}, #{addTime}, 0)
|
|
|
</insert>
|
|
|
|
|
|
- <update id="updateByStatus">
|
|
|
- UPDATE club SET status = #{clubStatus} WHERE userID = #{confirmUserId}
|
|
|
- </update>
|
|
|
+ <update id="updateByStatus">
|
|
|
+ UPDATE club
|
|
|
+ SET status = #{clubStatus}
|
|
|
+ WHERE userID = #{confirmUserId}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <select id="findLowOrder" resultType="com.caimei.modules.user.entity.UserBeansHistory">
|
|
|
+ select userId, type, beansType, orderId, num, addTime
|
|
|
+ from user_beans_history
|
|
|
+ where orderId = #{orderId}
|
|
|
+ and delFlag = 0
|
|
|
+ and type = 2
|
|
|
+ and num = 500
|
|
|
+ </select>
|
|
|
+ <select id="findRegistList" resultType="com.caimei.modules.user.entity.CmClubRemarks">
|
|
|
+ SELECT DISTINCT
|
|
|
+ ccr.id AS remarksId, ccr.remarks,s.linkman AS spName, ccr.addTime,ccr.questionMan,
|
|
|
+ csr.leaderId AS leaderId,ifnull(ccr.consultType,'') as consult, c.Name as clubName,
|
|
|
+ (SELECT NAME FROM serviceprovider s WHERE s.serviceProviderID= csr.leaderId) AS leaderName
|
|
|
+ FROM cm_club_remarks ccr
|
|
|
+ LEFT JOIN serviceprovider s ON ccr.serviceProviderId = s.serviceProviderID
|
|
|
+ LEFT JOIN club c ON c.clubId=ccr.clubId
|
|
|
+ LEFT JOIN cm_serviceTeam_group csg ON ccr.serviceProviderId = csg.serviceId
|
|
|
+ LEFT JOIN cm_serviceTeam_role csr ON csr.id = csg.teamId
|
|
|
+ <where>
|
|
|
+ <if test="remarks != null and remarks !=''">
|
|
|
+ AND ccr.remarks LIKE concat('%',#{remarks},'%')
|
|
|
+ </if>
|
|
|
+ <if test="clubName !=null and clubName !=''">
|
|
|
+ AND c.Name like concat('%',#{clubName},'%')
|
|
|
+ </if>
|
|
|
+ <if test="leaderId != null">
|
|
|
+ and csr.leaderId = #{leaderId}
|
|
|
+ </if>
|
|
|
+ <if test="serviceProviderId != null">
|
|
|
+ and csg.serviceId = #{serviceProviderId}
|
|
|
+ </if>
|
|
|
+ <if test="startAddTime != null and startAddTime != ''">
|
|
|
+ and ccr.addTime <![CDATA[ > ]]> #{startAddTime}
|
|
|
+ </if>
|
|
|
+ <if test="endAddTime != null and endAddTime != ''">
|
|
|
+ and ccr.addTime <![CDATA[ < ]]> #{endAddTime}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ ORDER BY ADDTIME DESC
|
|
|
+ </select>
|
|
|
+ <select id="findConsults" resultType="com.caimei.modules.consult.entity.type.CmConsulttype">
|
|
|
+ select id, className, createdTime
|
|
|
+ from cm_consulttype
|
|
|
+ where delflag = 0
|
|
|
+ </select>
|
|
|
+ <select id="findTeams" resultType="com.caimei.modules.user.entity.CmSaleMan">
|
|
|
+ select csr.leaderId, s.name as leaderName
|
|
|
+ from cm_serviceteam_role csr
|
|
|
+ left join serviceprovider s on s.serviceProviderID = csr.leaderId
|
|
|
+ where csr.delflag = 0
|
|
|
+ </select>
|
|
|
+ <select id="findGroup" resultType="com.caimei.modules.project.model.ServiceProviderModel">
|
|
|
+ SELECT serviceId as serviceProviderID, s.name
|
|
|
+ FROM cm_serviceteam_group csg
|
|
|
+ LEFT JOIN cm_serviceTeam_role csr ON csr.id = csg.teamid
|
|
|
+ LEFT JOIN serviceprovider s ON s.serviceProviderID = csg.serviceId
|
|
|
+ WHERE csr.leaderId = #{leaderId}
|
|
|
+ </select>
|
|
|
+ <select id="findClassName" resultType="java.lang.String">
|
|
|
+ select className
|
|
|
+ from cm_consulttype
|
|
|
+ where id = #{string}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <insert id="insert">
|
|
|
+ INSERT INTO `cm_remarks`(remarks, `addtime`)
|
|
|
+ VALUES (#{remarks}, #{addtime})
|
|
|
+ </insert>
|
|
|
+ <update id="updateByStatus">
|
|
|
+ UPDATE `cm_remarks`
|
|
|
+ SET remarks = #{remarks}
|
|
|
+ WHERE remarksId = #{remarksId}
|
|
|
+ </update>
|
|
|
|
|
|
- <select id="findLowOrder" resultType="com.caimei.modules.user.entity.UserBeansHistory">
|
|
|
- select userId, type, beansType, orderId, num, addTime
|
|
|
- from user_beans_history
|
|
|
- where orderId = #{orderId}
|
|
|
- and delFlag = 0
|
|
|
- and type = 2
|
|
|
- and num = 500
|
|
|
- </select>
|
|
|
- <select id="findRegistList" resultType="com.caimei.modules.user.entity.CmClubRemarks">
|
|
|
- SELECT DISTINCT
|
|
|
- ccr.id AS remarksId, ccr.remarks,s.linkman AS spName, ccr.addTime,ccr.questionMan,
|
|
|
- csr.leaderId AS leaderId,ifnull(ccr.consultType,'') as consult, c.Name as clubName,
|
|
|
- (SELECT NAME FROM serviceprovider s WHERE s.serviceProviderID= csr.leaderId) AS leaderName
|
|
|
- FROM cm_club_remarks ccr
|
|
|
- LEFT JOIN serviceprovider s ON ccr.serviceProviderId = s.serviceProviderID
|
|
|
- LEFT JOIN club c ON c.clubId=ccr.clubId
|
|
|
- LEFT JOIN cm_serviceTeam_group csg ON ccr.serviceProviderId = csg.serviceId
|
|
|
- LEFT JOIN cm_serviceTeam_role csr ON csr.id = csg.teamId
|
|
|
- <where>
|
|
|
- <if test="remarks != null and remarks !=''">
|
|
|
- AND ccr.remarks LIKE concat('%',#{remarks},'%')
|
|
|
- </if>
|
|
|
- <if test="clubName !=null and clubName !=''">
|
|
|
- AND c.Name like concat('%',#{clubName},'%')
|
|
|
- </if>
|
|
|
- <if test="leaderId != null">
|
|
|
- and csr.leaderId = #{leaderId}
|
|
|
- </if>
|
|
|
- <if test="serviceProviderId != null">
|
|
|
- and csg.serviceId = #{serviceProviderId}
|
|
|
- </if>
|
|
|
- <if test="startAddTime != null and startAddTime != ''">
|
|
|
- and ccr.addTime <![CDATA[ > ]]> #{startAddTime}
|
|
|
- </if>
|
|
|
- <if test="endAddTime != null and endAddTime != ''">
|
|
|
- and ccr.addTime <![CDATA[ < ]]> #{endAddTime}
|
|
|
- </if>
|
|
|
- </where>
|
|
|
- ORDER BY ADDTIME DESC
|
|
|
- </select>
|
|
|
- <select id="findConsults" resultType="com.caimei.modules.consult.entity.type.CmConsulttype">
|
|
|
- select id,className,createdTime from cm_consulttype
|
|
|
- where delflag = 0
|
|
|
- </select>
|
|
|
- <select id="findTeams" resultType="com.caimei.modules.user.entity.CmSaleMan">
|
|
|
- select csr.leaderId,s.name as leaderName
|
|
|
- from cm_serviceteam_role csr
|
|
|
- left join serviceprovider s on s.serviceProviderID = csr.leaderId
|
|
|
- where csr.delflag = 0
|
|
|
- </select>
|
|
|
- <select id="findGroup" resultType="com.caimei.modules.project.model.ServiceProviderModel">
|
|
|
- SELECT serviceId as serviceProviderID,s.name FROM
|
|
|
- cm_serviceteam_group csg
|
|
|
- LEFT JOIN cm_serviceTeam_role csr ON csr.id=csg.teamid
|
|
|
- LEFT JOIN serviceprovider s ON s.serviceProviderID=csg.serviceId
|
|
|
- WHERE csr.leaderId = #{leaderId}
|
|
|
- </select>
|
|
|
- <select id="findClassName" resultType="java.lang.String">
|
|
|
- select className from cm_consulttype where id = #{string}
|
|
|
- </select>
|
|
|
</mapper>
|