|
@@ -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.NewCmShopDao">
|
|
|
|
|
|
- <sql id="newCmShopColumns">
|
|
|
- a.shopID AS "shopID",
|
|
|
+ <sql id="newCmShopColumns">
|
|
|
+ a.shopID AS "shopID",
|
|
|
a.checkMan as "checkMan",
|
|
|
a.userID AS "userID",
|
|
|
a.name AS "name",
|
|
@@ -61,411 +61,437 @@
|
|
|
a.cardNumber AS "cardNumber",
|
|
|
a.chargeSupport AS "chargeSupport",
|
|
|
d.name AS "province",c.name AS "city",b.name AS "town"
|
|
|
- </sql>
|
|
|
+ </sql>
|
|
|
|
|
|
- <sql id="newCmShopJoins">
|
|
|
- LEFT JOIN user u ON u.userID = a.userID
|
|
|
+ <sql id="newCmShopJoins">
|
|
|
+ LEFT JOIN user u ON u.userID = a.userID
|
|
|
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="NewCmShop">
|
|
|
- SELECT
|
|
|
- <include refid="newCmShopColumns"/>
|
|
|
- FROM shop a
|
|
|
- <include refid="newCmShopJoins"/>
|
|
|
- WHERE a.shopID = #{id}
|
|
|
- </select>
|
|
|
+ <select id="get" resultType="NewCmShop">
|
|
|
+ SELECT
|
|
|
+ <include refid="newCmShopColumns"/>
|
|
|
+ FROM shop a
|
|
|
+ <include refid="newCmShopJoins"/>
|
|
|
+ WHERE a.shopID = #{id}
|
|
|
+ </select>
|
|
|
|
|
|
- <select id="getShopcert" resultType="com.caimei.modules.cibe.entity.ShopCert">
|
|
|
- SELECT
|
|
|
- *
|
|
|
- FROM shopcert s
|
|
|
- WHERE s.shopID = #{shopId}
|
|
|
- and s.shopCertTypeID = #{type}
|
|
|
- </select>
|
|
|
+ <select id="getShopcert" resultType="com.caimei.modules.cibe.entity.ShopCert">
|
|
|
+ SELECT *
|
|
|
+ FROM shopcert s
|
|
|
+ WHERE s.shopID = #{shopId}
|
|
|
+ and s.shopCertTypeID = #{type}
|
|
|
+ </select>
|
|
|
|
|
|
- <select id="findList" resultType="NewCmShop">
|
|
|
- SELECT
|
|
|
- <include refid="newCmShopColumns"/>
|
|
|
- FROM shop a
|
|
|
- <include refid="newCmShopJoins"/>
|
|
|
- <where>
|
|
|
- <if test="name != null and name != ''">
|
|
|
- AND a.name LIKE concat('%',#{name},'%')
|
|
|
- </if>
|
|
|
- <if test="status != null and status != ''">
|
|
|
- AND a.status = #{status}
|
|
|
- </if>
|
|
|
- <if test="contractMobile != null and contractMobile != ''">
|
|
|
- AND a.contractMobile = #{contractMobile}
|
|
|
- </if>
|
|
|
- <if test="linkMan != null and linkMan != ''">
|
|
|
- AND a.linkMan LIKE concat('%',#{linkMan},'%')
|
|
|
- </if>
|
|
|
- <if test="shopType !=null">
|
|
|
- AND a.shopType = #{shopType}
|
|
|
- </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="email != null and email != ''">
|
|
|
- AND u.email = #{email}
|
|
|
- </if>
|
|
|
- <if test="source != null and source != ''">
|
|
|
- AND u.source = #{source}
|
|
|
- </if>
|
|
|
- <if test="shopID != null and shopID>0">
|
|
|
- AND a.shopID = #{shopID}
|
|
|
- </if>
|
|
|
- </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.shopID DESC
|
|
|
- </otherwise>
|
|
|
- </choose>
|
|
|
- </select>
|
|
|
+ <select id="findList" resultType="NewCmShop">
|
|
|
+ SELECT
|
|
|
+ <include refid="newCmShopColumns"/>
|
|
|
+ FROM shop a
|
|
|
+ <include refid="newCmShopJoins"/>
|
|
|
+ <where>
|
|
|
+ <if test="name != null and name != ''">
|
|
|
+ AND a.name LIKE concat('%',#{name},'%')
|
|
|
+ </if>
|
|
|
+ <if test="status != null and status != ''">
|
|
|
+ AND a.status = #{status}
|
|
|
+ </if>
|
|
|
+ <if test="contractMobile != null and contractMobile != ''">
|
|
|
+ AND a.contractMobile = #{contractMobile}
|
|
|
+ </if>
|
|
|
+ <if test="linkMan != null and linkMan != ''">
|
|
|
+ AND a.linkMan LIKE concat('%',#{linkMan},'%')
|
|
|
+ </if>
|
|
|
+ <if test="shopType !=null">
|
|
|
+ AND a.shopType = #{shopType}
|
|
|
+ </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="email != null and email != ''">
|
|
|
+ AND u.email = #{email}
|
|
|
+ </if>
|
|
|
+ <if test="source != null and source != ''">
|
|
|
+ AND u.source = #{source}
|
|
|
+ </if>
|
|
|
+ <if test="shopID != null and shopID>0">
|
|
|
+ AND a.shopID = #{shopID}
|
|
|
+ </if>
|
|
|
+ </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.shopID DESC
|
|
|
+ </otherwise>
|
|
|
+ </choose>
|
|
|
+ </select>
|
|
|
|
|
|
- <select id="findAllList" resultType="NewCmShop">
|
|
|
- SELECT
|
|
|
- <include refid="newCmShopColumns"/>
|
|
|
- FROM shop a
|
|
|
- <include refid="newCmShopJoins"/>
|
|
|
- <where>
|
|
|
- </where>
|
|
|
- <choose>
|
|
|
- <when test="page !=null and page.orderBy != null and page.orderBy != ''">
|
|
|
- ORDER BY ${page.orderBy}
|
|
|
- </when>
|
|
|
- <otherwise>
|
|
|
- </otherwise>
|
|
|
- </choose>
|
|
|
- </select>
|
|
|
- <select id="findSplitCode" resultType="com.caimei.modules.user.entity.SplitCode">
|
|
|
- select shopId,commercialCode as splitCode,codeDetail as codeRemark,email as email,weChatFlag
|
|
|
- from cm_shop_splitcode
|
|
|
- where shopId = #{shopID}
|
|
|
- </select>
|
|
|
+ <select id="findAllList" resultType="NewCmShop">
|
|
|
+ SELECT
|
|
|
+ <include refid="newCmShopColumns"/>
|
|
|
+ FROM shop a
|
|
|
+ <include refid="newCmShopJoins"/>
|
|
|
+ <where>
|
|
|
+ </where>
|
|
|
+ <choose>
|
|
|
+ <when test="page !=null and page.orderBy != null and page.orderBy != ''">
|
|
|
+ ORDER BY ${page.orderBy}
|
|
|
+ </when>
|
|
|
+ <otherwise>
|
|
|
+ </otherwise>
|
|
|
+ </choose>
|
|
|
+ </select>
|
|
|
+ <select id="findSplitCode" resultType="com.caimei.modules.user.entity.SplitCode">
|
|
|
+ select shopId, commercialCode as splitCode, codeDetail as codeRemark, email as email, weChatFlag
|
|
|
+ from cm_shop_splitcode
|
|
|
+ where shopId = #{shopID}
|
|
|
+ </select>
|
|
|
|
|
|
- <insert id="saveShopcert" parameterType="com.caimei.modules.cibe.entity.ShopCert" keyProperty="shopCertID" useGeneratedKeys="true">
|
|
|
- INSERT INTO `shopcert` (
|
|
|
- `shopID`,
|
|
|
- `shopCertTypeID`,
|
|
|
- `name`,
|
|
|
- `image`,
|
|
|
- `organization`,
|
|
|
- `effectDate`,
|
|
|
- `loseEfficacyDate`
|
|
|
- )
|
|
|
- VALUES(
|
|
|
- #{shopID},
|
|
|
- #{shopCertTypeID},
|
|
|
- #{name},
|
|
|
- #{image},
|
|
|
- #{organization},
|
|
|
- #{effectDate},
|
|
|
- #{loseEfficacyDate}
|
|
|
- )
|
|
|
+ <insert id="saveShopcert" parameterType="com.caimei.modules.cibe.entity.ShopCert" keyProperty="shopCertID"
|
|
|
+ useGeneratedKeys="true">
|
|
|
+ INSERT INTO `shopcert` (`shopID`,
|
|
|
+ `shopCertTypeID`,
|
|
|
+ `name`,
|
|
|
+ `image`,
|
|
|
+ `organization`,
|
|
|
+ `effectDate`,
|
|
|
+ `loseEfficacyDate`)
|
|
|
+ VALUES (#{shopID},
|
|
|
+ #{shopCertTypeID},
|
|
|
+ #{name},
|
|
|
+ #{image},
|
|
|
+ #{organization},
|
|
|
+ #{effectDate},
|
|
|
+ #{loseEfficacyDate})
|
|
|
</insert>
|
|
|
|
|
|
|
|
|
- <insert id="insert" parameterType="NewCmShop" keyProperty="shopID" useGeneratedKeys="true">
|
|
|
- INSERT INTO shop(
|
|
|
- userID,
|
|
|
- name,
|
|
|
- sname,
|
|
|
- logo,
|
|
|
- legalPerson,
|
|
|
- businessLicense,
|
|
|
- businessLicenseImage,
|
|
|
- taxCertificate,
|
|
|
- taxCertificateImage,
|
|
|
- provinceID,
|
|
|
- cityID,
|
|
|
- townID,
|
|
|
- address,
|
|
|
- registeredCapital,
|
|
|
- nature,
|
|
|
- turnover,
|
|
|
- linkMan,
|
|
|
- contractPhone,
|
|
|
- contractMobile,
|
|
|
- contractEmail,
|
|
|
- fax,
|
|
|
- zipCode,
|
|
|
- info,
|
|
|
- productDesc,
|
|
|
- addTime,
|
|
|
- auditStatus,
|
|
|
- auditTime,
|
|
|
- auditNote,
|
|
|
- validFlag,
|
|
|
- status,
|
|
|
- maintenanceFee,
|
|
|
- maintenanceDate,
|
|
|
- businessScope,
|
|
|
- firstShopType,
|
|
|
- secondShopType,
|
|
|
- medicalPracticeLicenseImg1,
|
|
|
- medicalPracticeLicenseImg2,
|
|
|
- medicalPracticeLicenseImg3,
|
|
|
- mainpro,
|
|
|
- socialCreditCode,
|
|
|
- shopType
|
|
|
- ) VALUES (
|
|
|
- #{userID},
|
|
|
- #{name},
|
|
|
- #{sname},
|
|
|
- #{logo},
|
|
|
- #{legalPerson},
|
|
|
- #{businessLicense},
|
|
|
- #{businessLicenseImage},
|
|
|
- #{taxCertificate},
|
|
|
- #{taxCertificateImage},
|
|
|
- #{provinceID},
|
|
|
- #{cityID},
|
|
|
- #{townID},
|
|
|
- #{address},
|
|
|
- #{registeredCapital},
|
|
|
- #{nature},
|
|
|
- #{turnover},
|
|
|
- #{linkMan},
|
|
|
- #{contractPhone},
|
|
|
- #{contractMobile},
|
|
|
- #{contractEmail},
|
|
|
- #{fax},
|
|
|
- #{zipCode},
|
|
|
- #{info},
|
|
|
- #{productDesc},
|
|
|
- #{addTime},
|
|
|
- #{auditStatus},
|
|
|
- #{auditTime},
|
|
|
- #{auditNote},
|
|
|
- #{validFlag},
|
|
|
- #{status},
|
|
|
- #{maintenanceFee},
|
|
|
- #{maintenanceDate},
|
|
|
- #{businessScope},
|
|
|
- #{firstShopType},
|
|
|
- #{secondShopType},
|
|
|
- #{medicalPracticeLicenseImg1},
|
|
|
- #{medicalPracticeLicenseImg2},
|
|
|
- #{medicalPracticeLicenseImg3},
|
|
|
- #{mainpro},
|
|
|
- #{socialCreditCode},
|
|
|
- #{shopType}
|
|
|
- )
|
|
|
- </insert>
|
|
|
- <insert id="insertSplitCode">
|
|
|
- insert into cm_shop_splitcode
|
|
|
- (shopId, commercialCode, codeDetail,email,weChatFlag)
|
|
|
- values (#{shopId},#{splitCode},#{codeRemark},#{email},#{weChatFlag})
|
|
|
- </insert>
|
|
|
- <insert id="insertSepcial" parameterType="NewCmShop" keyProperty="shopID" useGeneratedKeys="true">
|
|
|
- insert into shop(name,linkMan,contractMobile,status,addTime,shopType)
|
|
|
- VALUES (#{name},#{linkMan},#{contractMobile},#{status},now(),2)
|
|
|
- </insert>
|
|
|
- <update id="update">
|
|
|
- UPDATE shop
|
|
|
- <set>
|
|
|
- <if test="name != null and name != ''" >
|
|
|
- name = #{name},
|
|
|
- </if>
|
|
|
- website = #{website},
|
|
|
- wxOfficialAccount = #{wxOfficialAccount},
|
|
|
- wxApplets = #{wxApplets},
|
|
|
- <if test="chargeSupport != null" >
|
|
|
- chargeSupport=#{chargeSupport},
|
|
|
- </if>
|
|
|
- <if test="sname != null and sname != ''" >
|
|
|
- sname = #{sname},
|
|
|
- </if>
|
|
|
- <if test="logo != null and logo != ''" >
|
|
|
- logo = #{logo},
|
|
|
- </if>
|
|
|
- <if test="legalPerson != null and legalPerson != ''" >
|
|
|
- legalPerson = #{legalPerson},
|
|
|
- </if>
|
|
|
- <if test="businessLicense != null and businessLicense != ''" >
|
|
|
- businessLicense = #{businessLicense},
|
|
|
- </if>
|
|
|
- <if test="businessLicenseImage != null and businessLicenseImage != ''" >
|
|
|
- businessLicenseImage = #{businessLicenseImage},
|
|
|
- </if>
|
|
|
- <if test="taxCertificate != null and taxCertificate != ''" >
|
|
|
- taxCertificate = #{taxCertificate},
|
|
|
- </if>
|
|
|
- <if test="taxCertificateImage != null and taxCertificateImage != ''" >
|
|
|
- taxCertificateImage = #{taxCertificateImage},
|
|
|
- </if>
|
|
|
- <if test="address != null and address != ''" >
|
|
|
- address = #{address},
|
|
|
- </if>
|
|
|
- <if test="registeredCapital != null and registeredCapital != ''" >
|
|
|
- registeredCapital = #{registeredCapital},
|
|
|
- </if>
|
|
|
- <if test="nature != null and nature != ''" >
|
|
|
- nature = #{nature},
|
|
|
- </if>
|
|
|
- <if test="turnover != null and turnover != ''" >
|
|
|
- turnover = #{turnover},
|
|
|
- </if>
|
|
|
- <if test="linkMan != null and linkMan != ''" >
|
|
|
- linkMan = #{linkMan},
|
|
|
- </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="zipCode != null and zipCode != ''" >
|
|
|
- zipCode = #{zipCode},
|
|
|
- </if>
|
|
|
- <if test="info != null and info != ''" >
|
|
|
- info = #{info},
|
|
|
- </if>
|
|
|
- <if test="productDesc != null and productDesc != ''" >
|
|
|
- productDesc = #{productDesc},
|
|
|
- </if>
|
|
|
- <if test="status != null and status != ''" >
|
|
|
- status = #{status},
|
|
|
- </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="maintenanceFee != null and maintenanceFee != ''" >
|
|
|
- maintenanceFee = #{maintenanceFee},
|
|
|
- </if>
|
|
|
- <if test="maintenanceDate != null and maintenanceDate != ''" >
|
|
|
- maintenanceDate = #{maintenanceDate},
|
|
|
- </if>
|
|
|
- <if test="businessScope != null and businessScope != ''" >
|
|
|
- businessScope = #{businessScope},
|
|
|
- </if>
|
|
|
- <if test="firstShopType != null and firstShopType != ''" >
|
|
|
- firstShopType=#{firstShopType},
|
|
|
- </if>
|
|
|
- <if test="secondShopType != null and secondShopType != ''" >
|
|
|
- secondShopType=#{secondShopType},
|
|
|
- </if>
|
|
|
- <if test="medicalPracticeLicenseImg1 != null and medicalPracticeLicenseImg1 != ''" >
|
|
|
- medicalPracticeLicenseImg1=#{medicalPracticeLicenseImg1},
|
|
|
- </if>
|
|
|
- <if test="medicalPracticeLicenseImg2 != null and medicalPracticeLicenseImg2 != ''" >
|
|
|
- medicalPracticeLicenseImg2=#{medicalPracticeLicenseImg2},
|
|
|
- </if>
|
|
|
- <if test="medicalPracticeLicenseImg3 != null and medicalPracticeLicenseImg3 != ''" >
|
|
|
- medicalPracticeLicenseImg3=#{medicalPracticeLicenseImg3},
|
|
|
- </if>
|
|
|
- <if test="mainpro != null and mainpro != ''">
|
|
|
- mainpro=#{mainpro},
|
|
|
- </if>
|
|
|
- <if test="ableRebateAmount != null">
|
|
|
- ableRebateAmount=#{ableRebateAmount},
|
|
|
- </if>
|
|
|
- <if test="rebateAmount != null">
|
|
|
- rebateAmount=#{rebateAmount},
|
|
|
- </if>
|
|
|
- <if test="bankAccount != null">
|
|
|
- bankAccount=#{bankAccount},
|
|
|
- </if>
|
|
|
- <if test="bankAccountName != null">
|
|
|
- bankAccountName=#{bankAccountName},
|
|
|
- </if>
|
|
|
- <if test="bankName != null">
|
|
|
- bankName=#{bankName},
|
|
|
- </if>
|
|
|
- <if test="socialCreditCode != null">
|
|
|
- socialCreditCode = #{socialCreditCode}
|
|
|
- </if>
|
|
|
- </set>
|
|
|
- WHERE shopID = #{shopID}
|
|
|
- </update>
|
|
|
+ <insert id="insert" parameterType="NewCmShop" keyProperty="shopID" useGeneratedKeys="true">
|
|
|
+ INSERT INTO shop(userID,
|
|
|
+ name,
|
|
|
+ sname,
|
|
|
+ logo,
|
|
|
+ legalPerson,
|
|
|
+ businessLicense,
|
|
|
+ businessLicenseImage,
|
|
|
+ taxCertificate,
|
|
|
+ taxCertificateImage,
|
|
|
+ provinceID,
|
|
|
+ cityID,
|
|
|
+ townID,
|
|
|
+ address,
|
|
|
+ registeredCapital,
|
|
|
+ nature,
|
|
|
+ turnover,
|
|
|
+ linkMan,
|
|
|
+ contractPhone,
|
|
|
+ contractMobile,
|
|
|
+ contractEmail,
|
|
|
+ fax,
|
|
|
+ zipCode,
|
|
|
+ info,
|
|
|
+ productDesc,
|
|
|
+ addTime,
|
|
|
+ auditStatus,
|
|
|
+ auditTime,
|
|
|
+ auditNote,
|
|
|
+ validFlag,
|
|
|
+ status,
|
|
|
+ maintenanceFee,
|
|
|
+ maintenanceDate,
|
|
|
+ businessScope,
|
|
|
+ firstShopType,
|
|
|
+ secondShopType,
|
|
|
+ medicalPracticeLicenseImg1,
|
|
|
+ medicalPracticeLicenseImg2,
|
|
|
+ medicalPracticeLicenseImg3,
|
|
|
+ mainpro,
|
|
|
+ socialCreditCode,
|
|
|
+ shopType)
|
|
|
+ VALUES (#{userID},
|
|
|
+ #{name},
|
|
|
+ #{sname},
|
|
|
+ #{logo},
|
|
|
+ #{legalPerson},
|
|
|
+ #{businessLicense},
|
|
|
+ #{businessLicenseImage},
|
|
|
+ #{taxCertificate},
|
|
|
+ #{taxCertificateImage},
|
|
|
+ #{provinceID},
|
|
|
+ #{cityID},
|
|
|
+ #{townID},
|
|
|
+ #{address},
|
|
|
+ #{registeredCapital},
|
|
|
+ #{nature},
|
|
|
+ #{turnover},
|
|
|
+ #{linkMan},
|
|
|
+ #{contractPhone},
|
|
|
+ #{contractMobile},
|
|
|
+ #{contractEmail},
|
|
|
+ #{fax},
|
|
|
+ #{zipCode},
|
|
|
+ #{info},
|
|
|
+ #{productDesc},
|
|
|
+ #{addTime},
|
|
|
+ #{auditStatus},
|
|
|
+ #{auditTime},
|
|
|
+ #{auditNote},
|
|
|
+ #{validFlag},
|
|
|
+ #{status},
|
|
|
+ #{maintenanceFee},
|
|
|
+ #{maintenanceDate},
|
|
|
+ #{businessScope},
|
|
|
+ #{firstShopType},
|
|
|
+ #{secondShopType},
|
|
|
+ #{medicalPracticeLicenseImg1},
|
|
|
+ #{medicalPracticeLicenseImg2},
|
|
|
+ #{medicalPracticeLicenseImg3},
|
|
|
+ #{mainpro},
|
|
|
+ #{socialCreditCode},
|
|
|
+ #{shopType})
|
|
|
+ </insert>
|
|
|
+ <insert id="insertSplitCode">
|
|
|
+ insert into cm_shop_splitcode
|
|
|
+ (shopId, commercialCode, codeDetail, email, weChatFlag)
|
|
|
+ values (#{shopId}, #{splitCode}, #{codeRemark}, #{email}, #{weChatFlag})
|
|
|
+ </insert>
|
|
|
+ <insert id="insertSepcial" parameterType="NewCmShop" keyProperty="shopID" useGeneratedKeys="true">
|
|
|
+ insert into shop(name, linkMan, contractMobile, status, addTime, shopType)
|
|
|
+ VALUES (#{name}, #{linkMan}, #{contractMobile}, #{status}, now(), 2)
|
|
|
+ </insert>
|
|
|
+ <update id="update">
|
|
|
+ UPDATE shop
|
|
|
+ <set>
|
|
|
+ <if test="name != null and name != ''">
|
|
|
+ name = #{name},
|
|
|
+ </if>
|
|
|
+ website = #{website},
|
|
|
+ wxOfficialAccount = #{wxOfficialAccount},
|
|
|
+ wxApplets = #{wxApplets},
|
|
|
+ <if test="chargeSupport != null">
|
|
|
+ chargeSupport=#{chargeSupport},
|
|
|
+ </if>
|
|
|
+ <if test="sname != null and sname != ''">
|
|
|
+ sname = #{sname},
|
|
|
+ </if>
|
|
|
+ <if test="logo != null and logo != ''">
|
|
|
+ logo = #{logo},
|
|
|
+ </if>
|
|
|
+ <if test="legalPerson != null and legalPerson != ''">
|
|
|
+ legalPerson = #{legalPerson},
|
|
|
+ </if>
|
|
|
+ <if test="businessLicense != null and businessLicense != ''">
|
|
|
+ businessLicense = #{businessLicense},
|
|
|
+ </if>
|
|
|
+ <if test="businessLicenseImage != null and businessLicenseImage != ''">
|
|
|
+ businessLicenseImage = #{businessLicenseImage},
|
|
|
+ </if>
|
|
|
+ <if test="taxCertificate != null and taxCertificate != ''">
|
|
|
+ taxCertificate = #{taxCertificate},
|
|
|
+ </if>
|
|
|
+ <if test="taxCertificateImage != null and taxCertificateImage != ''">
|
|
|
+ taxCertificateImage = #{taxCertificateImage},
|
|
|
+ </if>
|
|
|
+ <if test="address != null and address != ''">
|
|
|
+ address = #{address},
|
|
|
+ </if>
|
|
|
+ <if test="registeredCapital != null and registeredCapital != ''">
|
|
|
+ registeredCapital = #{registeredCapital},
|
|
|
+ </if>
|
|
|
+ <if test="nature != null and nature != ''">
|
|
|
+ nature = #{nature},
|
|
|
+ </if>
|
|
|
+ <if test="turnover != null and turnover != ''">
|
|
|
+ turnover = #{turnover},
|
|
|
+ </if>
|
|
|
+ <if test="linkMan != null and linkMan != ''">
|
|
|
+ linkMan = #{linkMan},
|
|
|
+ </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="zipCode != null and zipCode != ''">
|
|
|
+ zipCode = #{zipCode},
|
|
|
+ </if>
|
|
|
+ <if test="info != null and info != ''">
|
|
|
+ info = #{info},
|
|
|
+ </if>
|
|
|
+ <if test="productDesc != null and productDesc != ''">
|
|
|
+ productDesc = #{productDesc},
|
|
|
+ </if>
|
|
|
+ <if test="status != null and status != ''">
|
|
|
+ status = #{status},
|
|
|
+ </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="maintenanceFee != null and maintenanceFee != ''">
|
|
|
+ maintenanceFee = #{maintenanceFee},
|
|
|
+ </if>
|
|
|
+ <if test="maintenanceDate != null and maintenanceDate != ''">
|
|
|
+ maintenanceDate = #{maintenanceDate},
|
|
|
+ </if>
|
|
|
+ <if test="businessScope != null and businessScope != ''">
|
|
|
+ businessScope = #{businessScope},
|
|
|
+ </if>
|
|
|
+ <if test="firstShopType != null and firstShopType != ''">
|
|
|
+ firstShopType=#{firstShopType},
|
|
|
+ </if>
|
|
|
+ <if test="secondShopType != null and secondShopType != ''">
|
|
|
+ secondShopType=#{secondShopType},
|
|
|
+ </if>
|
|
|
+ <if test="medicalPracticeLicenseImg1 != null and medicalPracticeLicenseImg1 != ''">
|
|
|
+ medicalPracticeLicenseImg1=#{medicalPracticeLicenseImg1},
|
|
|
+ </if>
|
|
|
+ <if test="medicalPracticeLicenseImg2 != null and medicalPracticeLicenseImg2 != ''">
|
|
|
+ medicalPracticeLicenseImg2=#{medicalPracticeLicenseImg2},
|
|
|
+ </if>
|
|
|
+ <if test="medicalPracticeLicenseImg3 != null and medicalPracticeLicenseImg3 != ''">
|
|
|
+ medicalPracticeLicenseImg3=#{medicalPracticeLicenseImg3},
|
|
|
+ </if>
|
|
|
+ <if test="mainpro != null and mainpro != ''">
|
|
|
+ mainpro=#{mainpro},
|
|
|
+ </if>
|
|
|
+ <if test="ableRebateAmount != null">
|
|
|
+ ableRebateAmount=#{ableRebateAmount},
|
|
|
+ </if>
|
|
|
+ <if test="rebateAmount != null">
|
|
|
+ rebateAmount=#{rebateAmount},
|
|
|
+ </if>
|
|
|
+ <if test="bankAccount != null">
|
|
|
+ bankAccount=#{bankAccount},
|
|
|
+ </if>
|
|
|
+ <if test="bankAccountName != null">
|
|
|
+ bankAccountName=#{bankAccountName},
|
|
|
+ </if>
|
|
|
+ <if test="bankName != null">
|
|
|
+ bankName=#{bankName},
|
|
|
+ </if>
|
|
|
+ <if test="socialCreditCode != null">
|
|
|
+ socialCreditCode = #{socialCreditCode}
|
|
|
+ </if>
|
|
|
+ </set>
|
|
|
+ WHERE shopID = #{shopID}
|
|
|
+ </update>
|
|
|
|
|
|
- <delete id="delete">
|
|
|
- DELETE FROM shop
|
|
|
- WHERE shopID = #{id}
|
|
|
- </delete>
|
|
|
+ <delete id="delete">
|
|
|
+ DELETE
|
|
|
+ FROM shop
|
|
|
+ WHERE shopID = #{id}
|
|
|
+ </delete>
|
|
|
|
|
|
- <delete id="deleteCert">
|
|
|
- DELETE FROM shopcert
|
|
|
- WHERE shopID = #{shopID}
|
|
|
- </delete>
|
|
|
- <delete id="deleteSplitCode">
|
|
|
- delete from cm_shop_splitcode
|
|
|
- where shopId = #{shopID}
|
|
|
- </delete>
|
|
|
+ <delete id="deleteCert">
|
|
|
+ DELETE
|
|
|
+ FROM shopcert
|
|
|
+ WHERE shopID = #{shopID}
|
|
|
+ </delete>
|
|
|
+ <delete id="deleteSplitCode">
|
|
|
+ delete
|
|
|
+ from cm_shop_splitcode
|
|
|
+ where shopId = #{shopID}
|
|
|
+ </delete>
|
|
|
|
|
|
- <update id="updateAbleRebateAmount" parameterType="NewCmShop">
|
|
|
- update shop set ableRebateAmount = #{ableRebateAmount} where shopID = #{shopID}
|
|
|
- </update>
|
|
|
+ <update id="updateAbleRebateAmount" parameterType="NewCmShop">
|
|
|
+ update shop
|
|
|
+ set ableRebateAmount = #{ableRebateAmount}
|
|
|
+ where shopID = #{shopID}
|
|
|
+ </update>
|
|
|
|
|
|
- <update id="backAbleRebateAmount" parameterType="NewCmShop">
|
|
|
- update shop set ableRebateAmount = (ableRebateAmount + #{balancePayFee}) where shopID = #{shopID}
|
|
|
- </update>
|
|
|
+ <update id="backAbleRebateAmount" parameterType="NewCmShop">
|
|
|
+ update shop
|
|
|
+ set ableRebateAmount = (ableRebateAmount + #{balancePayFee})
|
|
|
+ where shopID = #{shopID}
|
|
|
+ </update>
|
|
|
|
|
|
- <update id="updateRebateAmount">
|
|
|
- update shop set rebateAmount = (rebateAmount - #{balancePayFee})
|
|
|
- where shopID = #{shopID}
|
|
|
- </update>
|
|
|
- <update id="offline">
|
|
|
- update shop set status = 91 where shopID = #{shopID}
|
|
|
- </update>
|
|
|
- <update id="online">
|
|
|
- update shop set status = 90 where shopID= #{shopID}
|
|
|
- </update>
|
|
|
+ <update id="updateRebateAmount">
|
|
|
+ update shop
|
|
|
+ set rebateAmount = (rebateAmount - #{balancePayFee})
|
|
|
+ where shopID = #{shopID}
|
|
|
+ </update>
|
|
|
+ <update id="offline">
|
|
|
+ update shop
|
|
|
+ set status = 91
|
|
|
+ where shopID = #{shopID}
|
|
|
+ </update>
|
|
|
+ <update id="online">
|
|
|
+ update shop
|
|
|
+ set status = 90
|
|
|
+ where shopID = #{shopID}
|
|
|
+ </update>
|
|
|
|
|
|
- <select id="maintenanceList" resultType="CmDiscernReceipt">
|
|
|
- SELECT
|
|
|
- a.id as receiptID,a.shopID,a.receiptAmount,a.receiptDate,a.receStatct,s.linkMan
|
|
|
- FROM cm_discern_receipt a
|
|
|
- LEFT JOIN shop s ON s.shopID = a.shopID
|
|
|
- <where>
|
|
|
- AND a.shopID=#{shopID}
|
|
|
- AND a.newReceiptType=1
|
|
|
- <if test="startTime != null and startTime != ''">
|
|
|
- AND (a.receiptDate > #{startTime} OR a.receiptDate = #{startTime})
|
|
|
- </if>
|
|
|
- <if test="endTime != null and endTime != ''">
|
|
|
- AND (a.receiptDate < #{endTime} OR a.receiptDate = #{endTime})
|
|
|
- </if>
|
|
|
- and a.receStatct is not null
|
|
|
- ORDER BY a.receiptDate DESC
|
|
|
- </where>
|
|
|
- <choose>
|
|
|
- <when test="page !=null and page.orderBy != null and page.orderBy != ''">
|
|
|
- ORDER BY ${page.orderBy}
|
|
|
- </when>
|
|
|
- </choose>
|
|
|
- </select>
|
|
|
- <insert id="Removethelastfee">
|
|
|
- insert into cm_discern_receipt
|
|
|
- (shopID, receStatct, receiptDate,delFlag,newReceiptType)
|
|
|
- values (#{shopID},#{receStatct}, #{receiptDate},1,1)
|
|
|
- </insert>
|
|
|
+ <select id="maintenanceList" resultType="CmDiscernReceipt">
|
|
|
+ SELECT
|
|
|
+ a.id as receiptID,a.shopID,a.receiptAmount,a.receiptDate,a.receStatct,s.linkMan
|
|
|
+ FROM cm_discern_receipt a
|
|
|
+ LEFT JOIN shop s ON s.shopID = a.shopID
|
|
|
+ <where>
|
|
|
+ AND a.shopID=#{shopID}
|
|
|
+ AND a.newReceiptType=1
|
|
|
+ <if test="startTime != null and startTime != ''">
|
|
|
+ AND (a.receiptDate > #{startTime} OR a.receiptDate = #{startTime})
|
|
|
+ </if>
|
|
|
+ <if test="endTime != null and endTime != ''">
|
|
|
+ AND (a.receiptDate < #{endTime} OR a.receiptDate = #{endTime})
|
|
|
+ </if>
|
|
|
+ and a.receStatct is not null
|
|
|
+ ORDER BY a.receiptDate DESC
|
|
|
+ </where>
|
|
|
+ <choose>
|
|
|
+ <when test="page !=null and page.orderBy != null and page.orderBy != ''">
|
|
|
+ ORDER BY ${page.orderBy}
|
|
|
+ </when>
|
|
|
+ </choose>
|
|
|
+ </select>
|
|
|
+ <insert id="Removethelastfee">
|
|
|
+ insert into cm_discern_receipt
|
|
|
+ (shopID, receStatct, receiptDate, delFlag, newReceiptType)
|
|
|
+ values (#{shopID}, #{receStatct}, #{receiptDate}, 1, 1)
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <update id="Removethelast">
|
|
|
+ update cm_discern_receipt
|
|
|
+ set newReceiptType=1,
|
|
|
+ receStatct = 1
|
|
|
+ where id = #{receiptID}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <insert id="cmreceipt">
|
|
|
+ insert into cm_receipt
|
|
|
+ (validityDate, dateStrings, receiptID)
|
|
|
+ values (#{validityDate}, #{expirationDate}, #{receiptID})
|
|
|
+ </insert>
|
|
|
|
|
|
- <update id="Removethelast">
|
|
|
- update cm_discern_receipt set newReceiptType=1,receStatct = 1 where id= #{receiptID}
|
|
|
- </update>
|
|
|
+ <select id="cmrectiptlist" resultType="com.caimei.modules.order.entity.CmDiscernReceipt">
|
|
|
+ SELECT r.dateStrings as expirationDate,
|
|
|
+ r.validityDate as validityDate
|
|
|
+ FROM cm_receipt r
|
|
|
+ LEFT JOIN cm_discern_receipt c ON c.id = r.receiptID
|
|
|
+ LEFT JOIN shop s ON s.shopID = c.shopID
|
|
|
+ WHERE c.shopID = #{shopID}
|
|
|
+ AND c.newReceiptType = 1
|
|
|
+ ORDER BY r.id DESC
|
|
|
+ LIMIT 1
|
|
|
+ </select>
|
|
|
|
|
|
</mapper>
|