| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199 |
- <?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.ruoyi.web.pcApi.mapper.TCustomerManageMapper">
-
- <resultMap type="TCustomerManage" id="TCustomerManageResult">
- <result property="id" column="id" />
- <result property="name" column="name" />
- <result property="username" column="username" />
- <result property="password" column="password" />
- <result property="integral" column="integral" />
- <result property="delFlag" column="del_flag" />
- <result property="deptId" column="dept_id" />
- <result property="createBy" column="create_by" />
- <result property="createTime" column="create_time" />
- <result property="updateBy" column="update_by" />
- <result property="updateTime" column="update_time" />
- <result property="remark" column="remark" />
- <result property="nickName" column="nick_name" />
- <result property="customerNo" column="customer_no" />
- </resultMap>
- <sql id="selectTCustomerManageVo">
- SELECT
- a.id,
- a.NAME,
- a.username,
- a.PASSWORD,
- a.integral,
- a.del_flag,
- a.dept_id,
- a.create_by,
- a.create_time,
- a.update_by,
- a.update_time,
- a.remark,
- a.customer_no,
- a.nick_name
- FROM
- t_customer_manage a
- </sql>
- <select id="selectTCustomerManageList" parameterType="TCustomerManage" resultMap="TCustomerManageResult">
- <include refid="selectTCustomerManageVo"/>
- where a.del_flag = '0'
- <if test="name != null and name != ''"> and a.name like concat('%', #{name}, '%')</if>
- <if test="nickName != null and nickName != ''"> and a.nick_name like concat('%', #{nickName}, '%')</if>
- <if test="username != null and username != ''"> and a.username like concat('%', #{username}, '%')</if>
- <if test="password != null and password != ''"> and a.password = #{password}</if>
- <if test="integral != null "> and a.integral = #{integral}</if>
- <if test="deptId != null "> and a.dept_id = #{deptId}</if>
- <!-- 数据范围过滤 -->
- ${params.dataScope}
- </select>
- <select id="selectTCustomerManageList4H5" parameterType="TCustomerManage" resultMap="TCustomerManageResult">
- <include refid="selectTCustomerManageVo"/>
- where a.del_flag = '0'
- <if test="name != null and name != ''"> and a.name like concat('%', #{name}, '%')</if>
- <if test="nickName != null and nickName != ''"> and a.nick_name like concat('%', #{nickName}, '%')</if>
- <if test="username != null and username != ''"> and a.username like concat('%', #{username}, '%')</if>
- <if test="password != null and password != ''"> and a.password = #{password}</if>
- <if test="integral != null "> and a.integral = #{integral}</if>
- <if test="deptId != null "> and a.dept_id = #{deptId}</if>
- </select>
-
- <select id="selectTCustomerManageById" parameterType="Long" resultMap="TCustomerManageResult">
- <include refid="selectTCustomerManageVo"/>
- where a.id = #{id}
- </select>
-
- <insert id="insertTCustomerManage" parameterType="TCustomerManage" useGeneratedKeys="true" keyProperty="id">
- insert into t_customer_manage
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="name != null">name,</if>
- <if test="username != null">username,</if>
- <if test="password != null">password,</if>
- <if test="integral != null">integral,</if>
- <if test="delFlag != null">del_flag,</if>
- <if test="deptId != null">dept_id,</if>
- <if test="createBy != null">create_by,</if>
- <if test="createTime != null">create_time,</if>
- <if test="updateBy != null">update_by,</if>
- <if test="updateTime != null">update_time,</if>
- <if test="remark != null">remark,</if>
- <if test="nickName != null">nick_name,</if>
- <if test="customerNo != null">customer_no,</if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="name != null">#{name},</if>
- <if test="username != null">#{username},</if>
- <if test="password != null">#{password},</if>
- <if test="integral != null">#{integral},</if>
- <if test="delFlag != null">#{delFlag},</if>
- <if test="deptId != null">#{deptId},</if>
- <if test="createBy != null">#{createBy},</if>
- <if test="createTime != null">#{createTime},</if>
- <if test="updateBy != null">#{updateBy},</if>
- <if test="updateTime != null">#{updateTime},</if>
- <if test="remark != null">#{remark},</if>
- <if test="nickName != null">#{nickName},</if>
- <if test="customerNo != null">#{customerNo},</if>
- </trim>
- </insert>
- <update id="updateTCustomerManage" parameterType="TCustomerManage">
- update t_customer_manage
- <trim prefix="SET" suffixOverrides=",">
- <if test="name != null">name = #{name},</if>
- <if test="username != null">username = #{username},</if>
- <if test="password != null">password = #{password},</if>
- <if test="integral != null">integral = #{integral},</if>
- <if test="delFlag != null">del_flag = #{delFlag},</if>
- <if test="deptId != null">dept_id = #{deptId},</if>
- <if test="createBy != null">create_by = #{createBy},</if>
- <if test="createTime != null">create_time = #{createTime},</if>
- <if test="updateBy != null">update_by = #{updateBy},</if>
- <if test="updateTime != null">update_time = #{updateTime},</if>
- <if test="remark != null">remark = #{remark},</if>
- <if test="nickName != null">nick_name = #{nickName},</if>
- <if test="customerNo != null">customer_no = #{customerNo},</if>
- </trim>
- where id = #{id}
- </update>
- <delete id="deleteTCustomerManageById" parameterType="Long">
- delete from t_customer_manage where id = #{id}
- </delete>
- <delete id="deleteTCustomerManageByIds" parameterType="String">
- delete from t_customer_manage where id in
- <foreach item="id" collection="array" open="(" separator="," close=")">
- #{id}
- </foreach>
- </delete>
- <select id="selectTCustomerDistributionRecordList" parameterType="TCustomerManage" resultMap="TCustomerManageResult">
- SELECT
- a.id,
- a.NAME,
- a.username,
- a.PASSWORD,
- a.integral,
- a.del_flag,
- a.dept_id,
- a.create_by,
- a.create_time,
- a.update_by,
- a.update_time,
- a.remark,
- (select sum(b.distribution_integral) from t_customer_distribution_record b where a.id = b.customer_id GROUP BY b.customer_id) totalNum
- FROM
- t_customer_manage a
- where a.del_flag = '0'
- <if test="name != null and name != ''"> and a.name like concat('%', #{name}, '%')</if>
- <if test="username != null and username != ''"> and a.username like concat('%', #{username}, '%')</if>
- <if test="password != null and password != ''"> and a.password = #{password}</if>
- <if test="integral != null "> and a.integral = #{integral}</if>
- <if test="deptId != null "> and a.dept_id = #{deptId}</if>
- <!-- 数据范围过滤 -->
- ${params.dataScope}
- </select>
- <select id="selectLoginUser" parameterType="loginCustomerManage" resultType="loginCustomerManage">
- SELECT
- a.id,
- a.NAME,
- a.username,
- a.PASSWORD,
- a.integral,
- a.del_flag delFlag,
- a.dept_id deptId,
- a.create_by,
- a.create_time,
- a.update_by,
- a.update_time,
- a.remark,
- a.dept_id,
- a.nick_name nickName
- FROM
- t_customer_manage a
- where 1=1
- <if test="username != null">
- and a.username = #{username}
- </if>
- <if test="id != null">
- and a.username = #{username}
- </if>
- <if test="deptId != null">
- and a.dept_id = #{deptId}
- </if>
- <if test="deptId == null">
- and a.dept_id is null
- </if>
- </select>
- </mapper>
|