|
@@ -0,0 +1,391 @@
|
|
|
|
+<?xml version="1.0" encoding="UTF-8" ?>
|
|
|
|
+<!DOCTYPE mapper
|
|
|
|
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
|
+<mapper namespace="com.caimei365.user.mapper.CmDistributionMapper">
|
|
|
|
+
|
|
|
|
+ <resultMap type="CmDistribution" id="CmDistributionResult">
|
|
|
|
+ <result property="id" column="id" />
|
|
|
|
+ <result property="userId" column="userId" />
|
|
|
|
+ <result property="name" column="name" />
|
|
|
|
+ <result property="linkMan" column="linkMan" />
|
|
|
|
+ <result property="mobile" column="mobile" />
|
|
|
|
+ <result property="password" column="password" />
|
|
|
|
+ <result property="corporateName" column="corporateName" />
|
|
|
|
+ <result property="splitCode" column="splitCode" />
|
|
|
|
+ <result property="bankName" column="bankName" />
|
|
|
|
+ <result property="bankAccount" column="bankAccount" />
|
|
|
|
+ <result property="status" column="status" />
|
|
|
|
+ <result property="qrCode" column="qrCode" />
|
|
|
|
+ <result property="parentId" column="parentId" />
|
|
|
|
+ <result property="parentIds" column="parentIds" />
|
|
|
|
+ <result property="updateTime" column="updateTime" />
|
|
|
|
+ <result property="addTime" column="addTime" />
|
|
|
|
+ <result property="delFlag" column="delFlag" />
|
|
|
|
+ <result property="image" column="image" />
|
|
|
|
+ </resultMap>
|
|
|
|
+
|
|
|
|
+ <sql id="selectCmDistributionVo">
|
|
|
|
+ select
|
|
|
|
+ cm_distribution.id,
|
|
|
|
+ cm_distribution.userId,
|
|
|
|
+ cm_distribution.name,
|
|
|
|
+ cm_distribution.linkMan,
|
|
|
|
+ cm_distribution.mobile,
|
|
|
|
+ cm_distribution.password,
|
|
|
|
+ cm_distribution.corporateName,
|
|
|
|
+ cm_distribution.splitCode,
|
|
|
|
+ cm_distribution.bankName,
|
|
|
|
+ cm_distribution.bankAccount,
|
|
|
|
+ cm_distribution.status,
|
|
|
|
+ cm_distribution.qrCode,
|
|
|
|
+ cm_distribution.parentId,
|
|
|
|
+ cm_distribution.parentIds,
|
|
|
|
+ cm_distribution.updateTime,
|
|
|
|
+ cm_distribution.addTime,
|
|
|
|
+ cm_distribution.delFlag,
|
|
|
|
+ u.image
|
|
|
|
+ </sql>
|
|
|
|
+
|
|
|
|
+ <select id="getByCmDistribution" parameterType="CmDistribution" resultMap="CmDistributionResult">
|
|
|
|
+ <include refid="selectCmDistributionVo"/>
|
|
|
|
+ from cm_distribution AS cm_distribution
|
|
|
|
+ left join user u on u.userId=cm_distribution.userId
|
|
|
|
+ <where> cm_distribution.delFlag = 0
|
|
|
|
+ <if test="id != null and id != ''">
|
|
|
|
+ and cm_distribution.id
|
|
|
|
+ <if test="id.toUpperCase().indexOf('=')==-1">
|
|
|
|
+ = #{id}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="id.toUpperCase().indexOf('=')!=-1">
|
|
|
|
+ <if test="id.toUpperCase().indexOf('NOT')!=-1"> not </if>
|
|
|
|
+ <if test="id.toUpperCase().indexOf('IN')!=-1"> in </if>
|
|
|
|
+ <foreach item="idIn" collection="id.substring(id.toUpperCase().indexOf('=')+1,id.length()).trim().split(',')" open="(" separator="," close=")">
|
|
|
|
+ #{idIn}
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+ </if>
|
|
|
|
+ <if test="userId != null "> and cm_distribution.userId = #{userId}</if>
|
|
|
|
+ <if test="name != null and name != ''"> and cm_distribution.name like concat('%', #{name}, '%')</if>
|
|
|
|
+ <if test="linkMan != null and linkMan != ''"> and cm_distribution.linkMan = #{linkMan}</if>
|
|
|
|
+ <if test="mobile != null and mobile != ''"> and cm_distribution.mobile = #{mobile}</if>
|
|
|
|
+ <if test="password != null and password != ''"> and cm_distribution.password = #{password}</if>
|
|
|
|
+ <if test="corporateName != null and corporateName != ''"> and cm_distribution.corporateName like concat('%', #{corporateName}, '%')</if>
|
|
|
|
+ <if test="splitCode != null and splitCode != ''"> and cm_distribution.splitCode = #{splitCode}</if>
|
|
|
|
+ <if test="bankName != null and bankName != ''"> and cm_distribution.bankName like concat('%', #{bankName}, '%')</if>
|
|
|
|
+ <if test="bankAccount != null and bankAccount != ''"> and cm_distribution.bankAccount = #{bankAccount}</if>
|
|
|
|
+ <if test="status != null "> and cm_distribution.status = #{status}</if>
|
|
|
|
+ <if test="qrCode != null and qrCode != ''"> and cm_distribution.qrCode = #{qrCode}</if>
|
|
|
|
+ <if test="parentId != null "> and cm_distribution.parentId = #{parentId}</if>
|
|
|
|
+ <if test="parentIds != null and parentIds != ''"> and cm_distribution.parentIds = #{parentIds}</if>
|
|
|
|
+ <if test="updateTime != null "> and cm_distribution.updateTime = #{updateTime}</if>
|
|
|
|
+ <if test="addTime != null "> and cm_distribution.addTime = #{addTime}</if>
|
|
|
|
+ </where>
|
|
|
|
+ group by cm_distribution.id
|
|
|
|
+ order by cm_distribution.addTime desc
|
|
|
|
+ limit 0,1
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+ <select id="getCmDistributionList" parameterType="CmDistribution" resultMap="CmDistributionResult">
|
|
|
|
+ <include refid="selectCmDistributionVo"/>
|
|
|
|
+ from cm_distribution AS cm_distribution
|
|
|
|
+ left join user u on u.userId=cm_distribution.userId
|
|
|
|
+ <where> cm_distribution.delFlag = 0
|
|
|
|
+ <if test="id != null and id != ''">
|
|
|
|
+ and cm_distribution.id
|
|
|
|
+ <if test="id.toUpperCase().indexOf('=')==-1">
|
|
|
|
+ = #{id}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="id.toUpperCase().indexOf('=')!=-1">
|
|
|
|
+ <if test="id.toUpperCase().indexOf('NOT')!=-1"> not </if>
|
|
|
|
+ <if test="id.toUpperCase().indexOf('IN')!=-1"> in </if>
|
|
|
|
+ <foreach item="idIn" collection="id.substring(id.toUpperCase().indexOf('=')+1,id.length()).trim().split(',')" open="(" separator="," close=")">
|
|
|
|
+ #{idIn}
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+ </if>
|
|
|
|
+ <if test="userId != null "> and cm_distribution.userId = #{userId}</if>
|
|
|
|
+ <if test="name != null and name != ''"> and cm_distribution.name like concat('%', #{name}, '%')</if>
|
|
|
|
+ <if test="linkMan != null and linkMan != ''"> and cm_distribution.linkMan = #{linkMan}</if>
|
|
|
|
+ <if test="mobile != null and mobile != ''"> and cm_distribution.mobile = #{mobile}</if>
|
|
|
|
+ <if test="password != null and password != ''"> and cm_distribution.password = #{password}</if>
|
|
|
|
+ <if test="corporateName != null and corporateName != ''"> and cm_distribution.corporateName like concat('%', #{corporateName}, '%')</if>
|
|
|
|
+ <if test="splitCode != null and splitCode != ''"> and cm_distribution.splitCode = #{splitCode}</if>
|
|
|
|
+ <if test="bankName != null and bankName != ''"> and cm_distribution.bankName like concat('%', #{bankName}, '%')</if>
|
|
|
|
+ <if test="bankAccount != null and bankAccount != ''"> and cm_distribution.bankAccount = #{bankAccount}</if>
|
|
|
|
+ <if test="status != null "> and cm_distribution.status = #{status}</if>
|
|
|
|
+ <if test="qrCode != null and qrCode != ''"> and cm_distribution.qrCode = #{qrCode}</if>
|
|
|
|
+ <if test="parentId != null "> and cm_distribution.parentId = #{parentId}</if>
|
|
|
|
+ <if test="parentIds != null and parentIds != ''"> and cm_distribution.parentIds = #{parentIds}</if>
|
|
|
|
+ <if test="updateTime != null "> and cm_distribution.updateTime = #{updateTime}</if>
|
|
|
|
+ <if test="addTime != null "> and cm_distribution.addTime = #{addTime}</if>
|
|
|
|
+ </where>
|
|
|
|
+ group by cm_distribution.id
|
|
|
|
+ order by cm_distribution.addTime desc
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+ <select id="getCmDistributionCount" parameterType="CmDistribution" resultType="int">
|
|
|
|
+ select count(1)
|
|
|
|
+ from cm_distribution AS cm_distribution
|
|
|
|
+ left join user u on u.userId=cm_distribution.userId
|
|
|
|
+ <where> cm_distribution.delFlag = 0
|
|
|
|
+ <if test="id != null and id != ''">
|
|
|
|
+ and cm_distribution.id
|
|
|
|
+ <if test="id.toUpperCase().indexOf('=')==-1">
|
|
|
|
+ = #{id}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="id.toUpperCase().indexOf('=')!=-1">
|
|
|
|
+ <if test="id.toUpperCase().indexOf('NOT')!=-1"> not </if>
|
|
|
|
+ <if test="id.toUpperCase().indexOf('IN')!=-1"> in </if>
|
|
|
|
+ <foreach item="idIn" collection="id.substring(id.toUpperCase().indexOf('=')+1,id.length()).trim().split(',')" open="(" separator="," close=")">
|
|
|
|
+ #{idIn}
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+ </if>
|
|
|
|
+ <if test="userId != null "> and cm_distribution.userId = #{userId}</if>
|
|
|
|
+ <if test="name != null and name != ''"> and cm_distribution.name like concat('%', #{name}, '%')</if>
|
|
|
|
+ <if test="linkMan != null and linkMan != ''"> and cm_distribution.linkMan = #{linkMan}</if>
|
|
|
|
+ <if test="mobile != null and mobile != ''"> and cm_distribution.mobile = #{mobile}</if>
|
|
|
|
+ <if test="password != null and password != ''"> and cm_distribution.password = #{password}</if>
|
|
|
|
+ <if test="corporateName != null and corporateName != ''"> and cm_distribution.corporateName like concat('%', #{corporateName}, '%')</if>
|
|
|
|
+ <if test="splitCode != null and splitCode != ''"> and cm_distribution.splitCode = #{splitCode}</if>
|
|
|
|
+ <if test="bankName != null and bankName != ''"> and cm_distribution.bankName like concat('%', #{bankName}, '%')</if>
|
|
|
|
+ <if test="bankAccount != null and bankAccount != ''"> and cm_distribution.bankAccount = #{bankAccount}</if>
|
|
|
|
+ <if test="status != null "> and cm_distribution.status = #{status}</if>
|
|
|
|
+ <if test="qrCode != null and qrCode != ''"> and cm_distribution.qrCode = #{qrCode}</if>
|
|
|
|
+ <if test="parentId != null "> and cm_distribution.parentId = #{parentId}</if>
|
|
|
|
+ <if test="parentIds != null and parentIds != ''"> and cm_distribution.parentIds = #{parentIds}</if>
|
|
|
|
+ <if test="updateTime != null "> and cm_distribution.updateTime = #{updateTime}</if>
|
|
|
|
+ <if test="addTime != null "> and cm_distribution.addTime = #{addTime}</if>
|
|
|
|
+ </where>
|
|
|
|
+ group by cm_distribution.id
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+ <select id="getCmDistributionById" parameterType="String" resultMap="CmDistributionResult">
|
|
|
|
+ <include refid="selectCmDistributionVo"/>
|
|
|
|
+ from cm_distribution AS cm_distribution
|
|
|
|
+ left join user u on u.userId=cm_distribution.userId
|
|
|
|
+ where cm_distribution.delFlag = 0 and cm_distribution.id = #{id}
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+ <select id="getByIds" parameterType="CmDistribution" resultType="String">
|
|
|
|
+ select id
|
|
|
|
+ from cm_distribution AS cm_distribution
|
|
|
|
+ left join user u on u.userId=cm_distribution.userId
|
|
|
|
+ <where> cm_distribution.delFlag = 0
|
|
|
|
+ <if test="id != null and id != ''">
|
|
|
|
+ and cm_distribution.id
|
|
|
|
+ <if test="id.toUpperCase().indexOf('=')==-1">
|
|
|
|
+ = #{id}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="id.toUpperCase().indexOf('=')!=-1">
|
|
|
|
+ <if test="id.toUpperCase().indexOf('NOT')!=-1"> not </if>
|
|
|
|
+ <if test="id.toUpperCase().indexOf('IN')!=-1"> in </if>
|
|
|
|
+ <foreach item="idIn" collection="id.substring(id.toUpperCase().indexOf('=')+1,id.length()).trim().split(',')" open="(" separator="," close=")">
|
|
|
|
+ #{idIn}
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+ </if>
|
|
|
|
+ <if test="userId != null "> and cm_distribution.userId = #{userId}</if>
|
|
|
|
+ <if test="name != null and name != ''"> and cm_distribution.name like concat('%', #{name}, '%')</if>
|
|
|
|
+ <if test="linkMan != null and linkMan != ''"> and cm_distribution.linkMan = #{linkMan}</if>
|
|
|
|
+ <if test="mobile != null and mobile != ''"> and cm_distribution.mobile = #{mobile}</if>
|
|
|
|
+ <if test="password != null and password != ''"> and cm_distribution.password = #{password}</if>
|
|
|
|
+ <if test="corporateName != null and corporateName != ''"> and cm_distribution.corporateName like concat('%', #{corporateName}, '%')</if>
|
|
|
|
+ <if test="splitCode != null and splitCode != ''"> and cm_distribution.splitCode = #{splitCode}</if>
|
|
|
|
+ <if test="bankName != null and bankName != ''"> and cm_distribution.bankName like concat('%', #{bankName}, '%')</if>
|
|
|
|
+ <if test="bankAccount != null and bankAccount != ''"> and cm_distribution.bankAccount = #{bankAccount}</if>
|
|
|
|
+ <if test="status != null "> and cm_distribution.status = #{status}</if>
|
|
|
|
+ <if test="qrCode != null and qrCode != ''"> and cm_distribution.qrCode = #{qrCode}</if>
|
|
|
|
+ <if test="parentId != null "> and cm_distribution.parentId = #{parentId}</if>
|
|
|
|
+ <if test="parentIds != null and parentIds != ''"> and cm_distribution.parentIds = #{parentIds}</if>
|
|
|
|
+ <if test="updateTime != null "> and cm_distribution.updateTime = #{updateTime}</if>
|
|
|
|
+ <if test="addTime != null "> and cm_distribution.addTime = #{addTime}</if>
|
|
|
|
+ </where>
|
|
|
|
+ group by cm_distribution.id
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+ <select id="getById" parameterType="CmDistribution" resultType="String">
|
|
|
|
+ select id
|
|
|
|
+ from cm_distribution AS cm_distribution
|
|
|
|
+ left join user u on u.userId=cm_distribution.userId
|
|
|
|
+ <where> cm_distribution.delFlag = 0
|
|
|
|
+ <if test="id != null and id != ''">
|
|
|
|
+ and cm_distribution.id
|
|
|
|
+ <if test="id.toString().toUpperCase().indexOf('=')==-1">
|
|
|
|
+ = #{id}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="id.toString().toUpperCase().indexOf('=')!=-1">
|
|
|
|
+ <if test="id.toString().toUpperCase().indexOf('NOT')!=-1"> not </if>
|
|
|
|
+ <if test="id.toString().toUpperCase().indexOf('IN')!=-1"> in </if>
|
|
|
|
+ <foreach item="idIn" collection="id.toString().substring(id.toString().toUpperCase().indexOf('=')+1,id.toString().length()).trim().split(',')" open="(" separator="," close=")">
|
|
|
|
+ #{idIn}
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+ </if>
|
|
|
|
+ <if test="userId != null "> and cm_distribution.userId = #{userId}</if>
|
|
|
|
+ <if test="name != null and name != ''"> and cm_distribution.name like concat('%', #{name}, '%')</if>
|
|
|
|
+ <if test="linkMan != null and linkMan != ''"> and cm_distribution.linkMan = #{linkMan}</if>
|
|
|
|
+ <if test="mobile != null and mobile != ''"> and cm_distribution.mobile = #{mobile}</if>
|
|
|
|
+ <if test="password != null and password != ''"> and cm_distribution.password = #{password}</if>
|
|
|
|
+ <if test="corporateName != null and corporateName != ''"> and cm_distribution.corporateName like concat('%', #{corporateName}, '%')</if>
|
|
|
|
+ <if test="splitCode != null and splitCode != ''"> and cm_distribution.splitCode = #{splitCode}</if>
|
|
|
|
+ <if test="bankName != null and bankName != ''"> and cm_distribution.bankName like concat('%', #{bankName}, '%')</if>
|
|
|
|
+ <if test="bankAccount != null and bankAccount != ''"> and cm_distribution.bankAccount = #{bankAccount}</if>
|
|
|
|
+ <if test="status != null "> and cm_distribution.status = #{status}</if>
|
|
|
|
+ <if test="qrCode != null and qrCode != ''"> and cm_distribution.qrCode = #{qrCode}</if>
|
|
|
|
+ <if test="parentId != null "> and cm_distribution.parentId = #{parentId}</if>
|
|
|
|
+ <if test="parentIds != null and parentIds != ''"> and cm_distribution.parentIds = #{parentIds}</if>
|
|
|
|
+ <if test="updateTime != null "> and cm_distribution.updateTime = #{updateTime}</if>
|
|
|
|
+ <if test="addTime != null "> and cm_distribution.addTime = #{addTime}</if>
|
|
|
|
+ </where>
|
|
|
|
+ group by cm_distribution.id
|
|
|
|
+ limit 0,1
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+ <select id="getLoginDistributionByMobile" resultType="com.caimei365.user.model.vo.UserLoginVo">
|
|
|
|
+ select u.userID as userId,
|
|
|
|
+ u.clubID as clubId,
|
|
|
|
+ u.shopID as shopId,
|
|
|
|
+ u.userName as userName,
|
|
|
|
+ u.name as name,
|
|
|
|
+ u.mobile as mobile,
|
|
|
|
+ u.bindMobile as bindMobile,
|
|
|
|
+ u.email as email,
|
|
|
|
+ u.image as image,
|
|
|
|
+ u.guideFlag as guideFlag,
|
|
|
|
+ u.userPermission as userPermission,
|
|
|
|
+ u.userIdentity as userIdentity,
|
|
|
|
+ u.serviceProviderID as serviceProviderId,
|
|
|
|
+ u.serviceProviderStatus as serviceStatus,
|
|
|
|
+ u.password as password
|
|
|
|
+ from user u
|
|
|
|
+ where u.bindMobile = #{mobile}
|
|
|
|
+ and u.userIdentity = 7
|
|
|
|
+ and u.validFlag = 1
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+ <insert id="addCmDistribution" parameterType="CmDistribution" useGeneratedKeys="true" keyProperty="id">
|
|
|
|
+ insert into cm_distribution
|
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
+ <if test="id != null and id != ''">id,</if>
|
|
|
|
+ <if test="userId != null">userId,</if>
|
|
|
|
+ <if test="name != null and name != ''">name,</if>
|
|
|
|
+ <if test="linkMan != null and linkMan != ''">linkMan,</if>
|
|
|
|
+ <if test="mobile != null and mobile != ''">mobile,</if>
|
|
|
|
+ <if test="password != null and password != ''">password,</if>
|
|
|
|
+ <if test="corporateName != null and corporateName != ''">corporateName,</if>
|
|
|
|
+ <if test="splitCode != null and splitCode != ''">splitCode,</if>
|
|
|
|
+ <if test="bankName != null and bankName != ''">bankName,</if>
|
|
|
|
+ <if test="bankAccount != null and bankAccount != ''">bankAccount,</if>
|
|
|
|
+ <if test="status != null">status,</if>
|
|
|
|
+ <if test="qrCode != null and qrCode != ''">qrCode,</if>
|
|
|
|
+ <if test="parentId != null">parentId,</if>
|
|
|
|
+ <if test="parentIds != null and parentIds != ''">parentIds,</if>
|
|
|
|
+ <if test="updateTime != null">updateTime,</if>
|
|
|
|
+ <if test="addTime != null">addTime,</if>
|
|
|
|
+ <if test="delFlag != null">delFlag,</if>
|
|
|
|
+ </trim>
|
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
|
+ <if test="id != null and id != ''">#{id},</if>
|
|
|
|
+ <if test="userId != null">#{userId},</if>
|
|
|
|
+ <if test="name != null and name != ''">#{name},</if>
|
|
|
|
+ <if test="linkMan != null and linkMan != ''">#{linkMan},</if>
|
|
|
|
+ <if test="mobile != null and mobile != ''">#{mobile},</if>
|
|
|
|
+ <if test="password != null and password != ''">#{password},</if>
|
|
|
|
+ <if test="corporateName != null and corporateName != ''">#{corporateName},</if>
|
|
|
|
+ <if test="splitCode != null and splitCode != ''">#{splitCode},</if>
|
|
|
|
+ <if test="bankName != null and bankName != ''">#{bankName},</if>
|
|
|
|
+ <if test="bankAccount != null and bankAccount != ''">#{bankAccount},</if>
|
|
|
|
+ <if test="status != null">#{status},</if>
|
|
|
|
+ <if test="qrCode != null and qrCode != ''">#{qrCode},</if>
|
|
|
|
+ <if test="parentId != null">#{parentId},</if>
|
|
|
|
+ <if test="parentIds != null and parentIds != ''">#{parentIds},</if>
|
|
|
|
+ <if test="updateTime != null">#{updateTime},</if>
|
|
|
|
+ <if test="addTime != null">#{addTime},</if>
|
|
|
|
+ <if test="delFlag != null">#{delFlag},</if>
|
|
|
|
+ </trim>
|
|
|
|
+ </insert>
|
|
|
|
+
|
|
|
|
+ <update id="updateCmDistribution" parameterType="CmDistribution">
|
|
|
|
+ update cm_distribution
|
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
|
+ <if test="userId != null">userId = #{userId},</if>
|
|
|
|
+ <if test="name != null and name != ''">name = #{name},</if>
|
|
|
|
+ <if test="linkMan != null and linkMan != ''">linkMan = #{linkMan},</if>
|
|
|
|
+ <if test="mobile != null and mobile != ''">mobile = #{mobile},</if>
|
|
|
|
+ <if test="password != null and password != ''">password = #{password},</if>
|
|
|
|
+ <if test="corporateName != null and corporateName != ''">corporateName = #{corporateName},</if>
|
|
|
|
+ <if test="splitCode != null and splitCode != ''">splitCode = #{splitCode},</if>
|
|
|
|
+ <if test="bankName != null and bankName != ''">bankName = #{bankName},</if>
|
|
|
|
+ <if test="bankAccount != null and bankAccount != ''">bankAccount = #{bankAccount},</if>
|
|
|
|
+ <if test="status != null">status = #{status},</if>
|
|
|
|
+ <if test="qrCode != null and qrCode != ''">qrCode = #{qrCode},</if>
|
|
|
|
+ <if test="parentId != null">parentId = #{parentId},</if>
|
|
|
|
+ <if test="parentIds != null and parentIds != ''">parentIds = #{parentIds},</if>
|
|
|
|
+ <if test="updateTime != null">updateTime = #{updateTime},</if>
|
|
|
|
+ <if test="addTime != null">addTime = #{addTime},</if>
|
|
|
|
+ <if test="delFlag != null">delFlag = #{delFlag},</if>
|
|
|
|
+ </trim>
|
|
|
|
+ where 1=1
|
|
|
|
+ <if test="id != null">and id = #{id}</if>
|
|
|
|
+ <if test="userId != null">and userId = #{userId}</if>
|
|
|
|
+ </update>
|
|
|
|
+
|
|
|
|
+ <update id="updateDelCmDistributionByIds" parameterType="String">
|
|
|
|
+ update cm_distribution set delFlag=#{delFlag} where id in
|
|
|
|
+ <foreach item="id" collection="ids" open="(" separator="," close=")">
|
|
|
|
+ #{id}
|
|
|
|
+ </foreach>
|
|
|
|
+ </update>
|
|
|
|
+
|
|
|
|
+ <delete id="delCmDistributionById" parameterType="String">
|
|
|
|
+ delete
|
|
|
|
+ from cm_distribution where id = #{id}
|
|
|
|
+ </delete>
|
|
|
|
+
|
|
|
|
+ <delete id="delCmDistribution" parameterType="CmDistribution">
|
|
|
|
+ delete
|
|
|
|
+ from cm_distribution AS cm_distribution
|
|
|
|
+ left join user u on u.userId=cm_distribution.userId
|
|
|
|
+ <where>
|
|
|
|
+ <if test="id != null and id != ''">
|
|
|
|
+ and cm_distribution.id
|
|
|
|
+ <if test="id.toUpperCase().indexOf('=')==-1">
|
|
|
|
+ = #{id}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="id.toUpperCase().indexOf('=')!=-1">
|
|
|
|
+ <if test="id.toUpperCase().indexOf('NOT')!=-1"> not </if>
|
|
|
|
+ <if test="id.toUpperCase().indexOf('IN')!=-1"> in </if>
|
|
|
|
+ <foreach item="idIn" collection="id.substring(id.toUpperCase().indexOf('=')+1,id.length()).trim().split(',')" open="(" separator="," close=")">
|
|
|
|
+ #{idIn}
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+ </if>
|
|
|
|
+ <if test="userId != null "> and cm_distribution.userId = #{userId}</if>
|
|
|
|
+ <if test="name != null and name != ''"> and cm_distribution.name like concat('%', #{name}, '%')</if>
|
|
|
|
+ <if test="linkMan != null and linkMan != ''"> and cm_distribution.linkMan = #{linkMan}</if>
|
|
|
|
+ <if test="mobile != null and mobile != ''"> and cm_distribution.mobile = #{mobile}</if>
|
|
|
|
+ <if test="password != null and password != ''"> and cm_distribution.password = #{password}</if>
|
|
|
|
+ <if test="corporateName != null and corporateName != ''"> and cm_distribution.corporateName like concat('%', #{corporateName}, '%')</if>
|
|
|
|
+ <if test="splitCode != null and splitCode != ''"> and cm_distribution.splitCode = #{splitCode}</if>
|
|
|
|
+ <if test="bankName != null and bankName != ''"> and cm_distribution.bankName like concat('%', #{bankName}, '%')</if>
|
|
|
|
+ <if test="bankAccount != null and bankAccount != ''"> and cm_distribution.bankAccount = #{bankAccount}</if>
|
|
|
|
+ <if test="status != null "> and cm_distribution.status = #{status}</if>
|
|
|
|
+ <if test="qrCode != null and qrCode != ''"> and cm_distribution.qrCode = #{qrCode}</if>
|
|
|
|
+ <if test="parentId != null "> and cm_distribution.parentId = #{parentId}</if>
|
|
|
|
+ <if test="parentIds != null and parentIds != ''"> and cm_distribution.parentIds = #{parentIds}</if>
|
|
|
|
+ <if test="updateTime != null "> and cm_distribution.updateTime = #{updateTime}</if>
|
|
|
|
+ <if test="addTime != null "> and cm_distribution.addTime = #{addTime}</if>
|
|
|
|
+ <if test="delFlag != null "> and cm_distribution.delFlag = #{delFlag}</if>
|
|
|
|
+ </where>
|
|
|
|
+ </delete>
|
|
|
|
+
|
|
|
|
+ <delete id="delCmDistributionByIds" parameterType="String">
|
|
|
|
+ delete from cm_distribution where id in
|
|
|
|
+ <foreach item="id" collection="ids" open="(" separator="," close=")">
|
|
|
|
+ #{id}
|
|
|
|
+ </foreach>
|
|
|
|
+ </delete>
|
|
|
|
+
|
|
|
|
+</mapper>
|