Browse Source

数据库优化

chao 3 years ago
parent
commit
265148930e

+ 8 - 11
src/main/java/com/caimei365/user/model/po/ServiceProviderPo.java

@@ -38,24 +38,21 @@ public class ServiceProviderPo implements Serializable {
      */
      */
     private String name;
     private String name;
     /**
     /**
-     * 联系手机
+     * 联系
      */
      */
-    private String contractMobile;
-
+    private String linkMan;
     /**
     /**
-     * 联系人1(默认联系人)
+     * 联系手机
      */
      */
-    private String linkMan1;
-
+    private String contractMobile;
     /**
     /**
-     * 联系人1职务
+     * 联系邮箱
      */
      */
-    private String duty1;
-
+    private String contractEmail;
     /**
     /**
-     * 联系人1手机
+     * 联系人职务
      */
      */
-    private String contractMobile1;
+    private String duty;
     /**
     /**
      * 审核状态
      * 审核状态
      */
      */

+ 2 - 2
src/main/resources/mapper/BaseMapper.xml

@@ -10,11 +10,11 @@
         where userID = #{userId}
         where userID = #{userId}
     </update>
     </update>
     <update id="updateShopMobileByShopId">
     <update id="updateShopMobileByShopId">
-        update shop set contractMobile = #{mobile}, contractMobile1 = #{mobile}
+        update shop set contractMobile = #{mobile}
         where shopID = #{shopId}
         where shopID = #{shopId}
     </update>
     </update>
     <update id="updateClubMobileByClubId">
     <update id="updateClubMobileByClubId">
-        update club set contractMobile = #{mobile}, contractMobile1 = #{mobile}
+        update club set contractMobile = #{mobile}
         where clubID = #{clubId}
         where clubID = #{clubId}
     </update>
     </update>
     <select id="getUserIdByEmail" resultType="java.lang.Integer">
     <select id="getUserIdByEmail" resultType="java.lang.Integer">

+ 2 - 2
src/main/resources/mapper/ClubMapper.xml

@@ -34,7 +34,7 @@
             sname = #{shortName},
             sname = #{shortName},
         </if>
         </if>
         <if test="contractEmail != null and contractEmail != ''">
         <if test="contractEmail != null and contractEmail != ''">
-            contractEmail1 = #{contractEmail},
+            contractEmail = #{contractEmail},
         </if>
         </if>
         contractPhone = #{contractPhone},
         contractPhone = #{contractPhone},
         <if test="linkMan != null and linkMan != ''">
         <if test="linkMan != null and linkMan != ''">
@@ -76,7 +76,7 @@
         delete from cm_club_remarks_file where remarksId = #{remarksId}
         delete from cm_club_remarks_file where remarksId = #{remarksId}
     </delete>
     </delete>
     <select id="getClubById" resultType="com.caimei365.user.model.vo.ClubVo">
     <select id="getClubById" resultType="com.caimei365.user.model.vo.ClubVo">
-        select clubID as clubId, userID as userId, name, sname as shortName, contractMobile, contractEmail1 as contractEmail,
+        select clubID as clubId, userID as userId, name, sname as shortName, contractMobile, contractEmail,
                contractPhone, linkMan, provinceID as proviceId, cityID as cityId, townID as townId,
                contractPhone, linkMan, provinceID as proviceId, cityID as cityId, townID as townId,
                address, headpic as shopPhoto, businessLicenseImage as businessLicense, socialCreditCode,
                address, headpic as shopPhoto, businessLicenseImage as businessLicense, socialCreditCode,
                firstClubType, secondClubType, department, medicalPracticeLicenseImg as medicalPracticeLicense,
                firstClubType, secondClubType, department, medicalPracticeLicenseImg as medicalPracticeLicense,

+ 0 - 9
src/main/resources/mapper/LoginMapper.xml

@@ -123,9 +123,6 @@
         <if test="source=='www'">
         <if test="source=='www'">
             o.pcOpenid as openId
             o.pcOpenid as openId
         </if>
         </if>
-        <if test="source=='crm'">
-            o.crmOpenid as openId
-        </if>
         <if test="source=='mini'">
         <if test="source=='mini'">
             o.openid as openId
             o.openid as openId
         </if>
         </if>
@@ -156,9 +153,6 @@
         <if test="source=='www'">
         <if test="source=='www'">
             o.pcOpenid as openId
             o.pcOpenid as openId
         </if>
         </if>
-        <if test="source=='crm'">
-            o.crmOpenid as openId
-        </if>
         <if test="source=='mini'">
         <if test="source=='mini'">
             o.openid as openId
             o.openid as openId
         </if>
         </if>
@@ -196,9 +190,6 @@
         <if test="source=='www'">
         <if test="source=='www'">
             pcOpenid = #{openId}
             pcOpenid = #{openId}
         </if>
         </if>
-        <if test="source=='crm'">
-            crmOpenid = #{openId}
-        </if>
         <if test="source=='mini'">
         <if test="source=='mini'">
             openid = #{openId}
             openid = #{openId}
         </if>
         </if>

+ 1 - 1
src/main/resources/mapper/OperationMapper.xml

@@ -35,7 +35,7 @@
     </select>
     </select>
     <select id="getOperationListByUserId" resultType="com.caimei365.user.model.vo.OperationVo">
     <select id="getOperationListByUserId" resultType="com.caimei365.user.model.vo.OperationVo">
         select id, userID as userId, userType, userOrganizeID as organizeId, clubID as clubId, shopID as shopId, account, mobile,
         select id, userID as userId, userType, userOrganizeID as organizeId, clubID as clubId, shopID as shopId, account, mobile,
-            linkName, headimgurl as avatarUrl, invitationCode, status, nickName, unionId, openid as openId, crmOpenid as crmOpenId, pcOpenid as pcOpenId,
+            linkName, headimgurl as avatarUrl, invitationCode, status, nickName, unionId, openid as openId, pcOpenid as pcOpenId,
             invitationCodeTime, bindTime, updateTime, addTime, delFlag
             invitationCodeTime, bindTime, updateTime, addTime, delFlag
         from cm_mall_operation_user
         from cm_mall_operation_user
         where userID = #{userId} and delFlag = 0
         where userID = #{userId} and delFlag = 0

+ 5 - 5
src/main/resources/mapper/RegisterMapper.xml

@@ -10,7 +10,7 @@
                   values(#{name},#{shortName},#{contractMobile},#{linkMan},#{userId},#{addTime},#{status},#{serviceProviderId},#{scanFlag})
                   values(#{name},#{shortName},#{contractMobile},#{linkMan},#{userId},#{addTime},#{status},#{serviceProviderId},#{scanFlag})
     </insert>
     </insert>
     <insert id="insertUpgradeClub" parameterType="com.caimei365.user.model.po.ClubPo" keyProperty="clubId" useGeneratedKeys="true">
     <insert id="insertUpgradeClub" parameterType="com.caimei365.user.model.po.ClubPo" keyProperty="clubId" useGeneratedKeys="true">
-        insert into club(`name`, `sname`,     `contractMobile`, `userID`, `addTime`, `status`, `spID`,              `scanFlag`,`contractEmail1`,`linkMan`, `provinceID`, `cityID`,`townID`, `address`, `headpic`, `businessLicenseImage`,`socialCreditCode`,`firstClubType`,`secondClubType`,`department`,`medicalPracticeLicenseImg`,`mainpro`)
+        insert into club(`name`, `sname`,     `contractMobile`, `userID`, `addTime`, `status`, `spID`,              `scanFlag`,`contractEmail`,`linkMan`, `provinceID`, `cityID`,`townID`, `address`, `headpic`, `businessLicenseImage`,`socialCreditCode`,`firstClubType`,`secondClubType`,`department`,`medicalPracticeLicenseImg`,`mainpro`)
                   values(#{name},#{shortName},#{contractMobile},#{userId},#{addTime},#{status},#{serviceProviderId},#{scanFlag},#{contractEmail},#{linkMan},#{provinceId},#{cityId},#{townId},#{address},#{shopPhoto},#{businessLicense},#{socialCreditCode},#{firstClubType},#{secondClubType},#{department},#{medicalPracticeLicense},#{mainProduct})
                   values(#{name},#{shortName},#{contractMobile},#{userId},#{addTime},#{status},#{serviceProviderId},#{scanFlag},#{contractEmail},#{linkMan},#{provinceId},#{cityId},#{townId},#{address},#{shopPhoto},#{businessLicense},#{socialCreditCode},#{firstClubType},#{secondClubType},#{department},#{medicalPracticeLicense},#{mainProduct})
     </insert>
     </insert>
     <insert id="insertOperation" parameterType="com.caimei365.user.model.po.OperationPo" keyProperty="id" useGeneratedKeys="true">
     <insert id="insertOperation" parameterType="com.caimei365.user.model.po.OperationPo" keyProperty="id" useGeneratedKeys="true">
@@ -22,7 +22,7 @@
         values(#{organizeId},#{registerTime},#{registerIp},#{source},#{registerUserTypeId},#{name},#{userName},#{bindMobile},#{email},#{userIdentity},#{userPermission},#{manufacturerStatus},#{password},#{agreeFlag},#{validFlag})
         values(#{organizeId},#{registerTime},#{registerIp},#{source},#{registerUserTypeId},#{name},#{userName},#{bindMobile},#{email},#{userIdentity},#{userPermission},#{manufacturerStatus},#{password},#{agreeFlag},#{validFlag})
     </insert>
     </insert>
     <insert id="insertShop" parameterType="com.caimei365.user.model.po.ShopPo" keyProperty="shopId" useGeneratedKeys="true">
     <insert id="insertShop" parameterType="com.caimei365.user.model.po.ShopPo" keyProperty="shopId" useGeneratedKeys="true">
-        insert into shop(`userID`, `name`, `sname`, `linkMan`, `contractMobile`, `contractEmail1`, `provinceID`, `cityID`, `townID`, `address`, `socialCreditCode`, `businessLicenseImage`, `firstShopType`, `secondShopType`, `mainpro`, `productDesc`, `info`, `website`, `wxOfficialAccount`, `wxApplets`, `addTime`, `validFlag`, `status`,medicalPracticeLicenseImg1)
+        insert into shop(`userID`, `name`, `sname`, `linkMan`, `contractMobile`, `contractEmail`, `provinceID`, `cityID`, `townID`, `address`, `socialCreditCode`, `businessLicenseImage`, `firstShopType`, `secondShopType`, `mainpro`, `productDesc`, `info`, `website`, `wxOfficialAccount`, `wxApplets`, `addTime`, `validFlag`, `status`,medicalPracticeLicenseImg1)
         values(#{userId},#{name},#{shortName},#{linkMan},#{contractMobile},#{contractEmail},#{provinceId},#{cityId},#{townId},#{address},#{socialCreditCode},#{businessLicense},#{firstShopType},#{secondShopType},#{mainProduct},#{mainProductDesc},#{shopDesc},#{website},#{wxOfficialAccount},#{wxApplets},#{addTime},#{validFlag},#{status},#{medicalPracticeLicenseImg1})
         values(#{userId},#{name},#{shortName},#{linkMan},#{contractMobile},#{contractEmail},#{provinceId},#{cityId},#{townId},#{address},#{socialCreditCode},#{businessLicense},#{firstShopType},#{secondShopType},#{mainProduct},#{mainProductDesc},#{shopDesc},#{website},#{wxOfficialAccount},#{wxApplets},#{addTime},#{validFlag},#{status},#{medicalPracticeLicenseImg1})
     </insert>
     </insert>
     <update id="updateUserClubId">
     <update id="updateUserClubId">
@@ -46,7 +46,7 @@
         where userID = #{userId}
         where userID = #{userId}
     </update>
     </update>
     <update id="updateClubByUpgrade">
     <update id="updateClubByUpgrade">
-        update club set userID = #{userId}, name = #{name}, sname = #{shortName}, contractEmail1 = #{contractEmail},
+        update club set userID = #{userId}, name = #{name}, sname = #{shortName}, contractEmail = #{contractEmail},
             <if test="contractPhone != null and contractPhone != ''">
             <if test="contractPhone != null and contractPhone != ''">
                 contractPhone = #{contractPhone},
                 contractPhone = #{contractPhone},
             </if>
             </if>
@@ -79,7 +79,7 @@
                 sname = #{shortName},
                 sname = #{shortName},
             </if>
             </if>
             <if test="email != null and email != ''">
             <if test="email != null and email != ''">
-                contractEmail1 = #{email},
+                contractEmail = #{email},
             </if>
             </if>
             <if test="linkMan != null and linkMan != ''">
             <if test="linkMan != null and linkMan != ''">
                 linkMan = #{linkMan},
                 linkMan = #{linkMan},
@@ -215,7 +215,7 @@
           contractPhone = #{contractPhone},
           contractPhone = #{contractPhone},
           contractMobile = #{contractMobile},
           contractMobile = #{contractMobile},
           fax = #{fax},
           fax = #{fax},
-          contractEmail1 = #{contractEmail},
+          contractEmail = #{contractEmail},
           info = #{profile},
           info = #{profile},
           addTime = #{addTime},
           addTime = #{addTime},
           status = #{status},
           status = #{status},

+ 5 - 5
src/main/resources/mapper/SellerMapper.xml

@@ -102,7 +102,7 @@
     </select>
     </select>
 
 
     <select id="findClubs" resultType="com.caimei365.user.model.vo.ClubVo">
     <select id="findClubs" resultType="com.caimei365.user.model.vo.ClubVo">
-        select c.clubID as clubId, c.userID as userId, c.name, c.sname as shortName, c.contractMobile, c.contractEmail1 as contractEmail,
+        select 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,
@@ -126,7 +126,7 @@
         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 c.clubID as clubId, c.userID as userId, c.name, c.sname as shortName, c.contractMobile, c.contractEmail1 as contractEmail,
+        SELECT 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,
@@ -138,14 +138,14 @@
         <if test="searchWord != null and searchWord != ''">
         <if test="searchWord != null and searchWord != ''">
             and (
             and (
             c.name LIKE CONCAT('%',#{searchWord},'%') or
             c.name LIKE CONCAT('%',#{searchWord},'%') or
-            c.linkMan1 LIKE CONCAT('%',#{searchWord},'%') or
-            c.contractMobile1 LIKE CONCAT('%',#{searchWord},'%')
+            c.linkMan LIKE CONCAT('%',#{searchWord},'%') or
+            c.contractMobile LIKE CONCAT('%',#{searchWord},'%')
             )
             )
         </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,
         select serviceProviderID AS serviceProviderId, status, userID AS userId, openid, unionId, name, contractMobile,
-               linkMan1, duty1, contractMobile1, auditStatus, auditTime, auditNote, validFlag, addTime,
+               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>

+ 2 - 3
src/main/resources/mapper/ShopMapper.xml

@@ -21,7 +21,7 @@
                 sname = #{shortName},
                 sname = #{shortName},
             </if>
             </if>
             <if test="contractEmail != null and contractEmail != ''">
             <if test="contractEmail != null and contractEmail != ''">
-                contractEmail1 = #{contractEmail},
+                contractEmail = #{contractEmail},
             </if>
             </if>
             <if test="contractPhone != null and contractPhone != ''">
             <if test="contractPhone != null and contractPhone != ''">
                 contractPhone = #{contractPhone},
                 contractPhone = #{contractPhone},
@@ -89,7 +89,7 @@
     </select>
     </select>
     <select id="getShopById" resultType="com.caimei365.user.model.vo.ShopVo">
     <select id="getShopById" resultType="com.caimei365.user.model.vo.ShopVo">
         select userID as userId, shopID as shopId, name, sname as shortName, linkMan, contractMobile,
         select userID as userId, shopID as shopId, name, sname as shortName, linkMan, contractMobile,
-               contractEmail1 as contractEmail, contractEmail1 as email, provinceID as proviceId, cityID as cityId, townID as townId,
+               contractEmail, contractEmail as email, provinceID as proviceId, cityID as cityId, townID as townId,
                address, socialCreditCode, businessLicenseImage as businessLicense, firstShopType, secondShopType,
                address, socialCreditCode, businessLicenseImage as businessLicense, firstShopType, secondShopType,
                mainpro as mainProduct, productDesc as mainProductDesc,legalPerson,registeredCapital,fax as faxNumber,
                mainpro as mainProduct, productDesc as mainProductDesc,legalPerson,registeredCapital,fax as faxNumber,
                nature as companyNature, turnover, medicalPracticeLicenseImg1 as medicalPracticeLicense, info as shopDesc,
                nature as companyNature, turnover, medicalPracticeLicenseImg1 as medicalPracticeLicense, info as shopDesc,
@@ -110,7 +110,6 @@
             s.authorizationCertificateImage as certificate,
             s.authorizationCertificateImage as certificate,
             s.info,
             s.info,
             s.productDesc,
             s.productDesc,
-            s.site,
             count(*) as normalNum
             count(*) as normalNum
         from shop s
         from shop s
         where s.shopID = #{supplierId}
         where s.shopID = #{supplierId}

+ 1 - 1
src/main/resources/mapper/SuperVipMapper.xml

@@ -192,7 +192,7 @@
     </select>
     </select>
 
 
     <insert id="insertShortLink">
     <insert id="insertShortLink">
-        INSERT INTO `caimei`.`cm_short_link` (
+        INSERT INTO  cm_short_link (
             `markId`, `shortLink`, `jumpLink`,
             `markId`, `shortLink`, `jumpLink`,
             `createTime`
             `createTime`
         )
         )