|
@@ -0,0 +1,128 @@
|
|
|
+<?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.xzl.system.mapper.BussIllegalCreditCustomerMapper">
|
|
|
+
|
|
|
+ <resultMap type="BussIllegalCreditCustomer" id="BussIllegalCreditCustomerResult">
|
|
|
+ <result property="id" column="id"/>
|
|
|
+ <result property="licenceNo" column="licence_no"/>
|
|
|
+ <result property="customerName" column="customer_name"/>
|
|
|
+ <result property="creditLevel" column="credit_level"/>
|
|
|
+ <result property="longitude" column="longitude"/>
|
|
|
+ <result property="latitude" column="latitude"/>
|
|
|
+ <result property="remark" column="remark"/>
|
|
|
+ <result property="delFlag" column="del_flag"/>
|
|
|
+ <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="address" column="address"/>
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <sql id="selectBussIllegalCreditCustomerVo">
|
|
|
+ select m.id, m.licence_no, m.customer_name, m.credit_level, m.longitude, m.latitude, m.remark, m.del_flag, m.create_by, m.create_time, m.update_by, m.update_time,
|
|
|
+ d.address
|
|
|
+ from buss_illegal_credit_customer m
|
|
|
+ left join v_b_client d on m.licence_no = d.client_code </sql>
|
|
|
+
|
|
|
+ <select id="selectBussIllegalCreditCustomerList" parameterType="BussIllegalCreditCustomer"
|
|
|
+ resultMap="BussIllegalCreditCustomerResult">
|
|
|
+ <include refid="selectBussIllegalCreditCustomerVo"/>
|
|
|
+ where m.del_flag = '0'
|
|
|
+ <if test="licenceNo != null and licenceNo != ''">and m.licence_no = #{licenceNo}</if>
|
|
|
+ <if test="customerName != null and customerName != ''">and m.customer_name like concat('%', #{customerName},
|
|
|
+ '%')
|
|
|
+ </if>
|
|
|
+ <if test="creditLevel != null and creditLevel != ''">and m.credit_level = #{creditLevel}</if>
|
|
|
+ <if test="creditLevels != null and creditLevels != ''">
|
|
|
+ and m.credit_level in
|
|
|
+ <foreach collection="creditLevels.split(',')" index="index" item="creditLevel" open="(" separator=","
|
|
|
+ close=")">
|
|
|
+ #{creditLevel}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+
|
|
|
+ order by m.credit_level asc
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectBussIllegalCreditCustomerById" parameterType="String" resultMap="BussIllegalCreditCustomerResult">
|
|
|
+ <include refid="selectBussIllegalCreditCustomerVo"/>
|
|
|
+ where id = #{id}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <insert id="insertBussIllegalCreditCustomer" parameterType="BussIllegalCreditCustomer">
|
|
|
+ insert into buss_illegal_credit_customer
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="id != null">id,</if>
|
|
|
+ <if test="licenceNo != null">licence_no,</if>
|
|
|
+ <if test="customerName != null">customer_name,</if>
|
|
|
+ <if test="creditLevel != null">credit_level,</if>
|
|
|
+ <if test="longitude != null">longitude,</if>
|
|
|
+ <if test="latitude != null">latitude,</if>
|
|
|
+ <if test="remark != null">remark,</if>
|
|
|
+ <if test="delFlag != null">del_flag,</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>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="id != null">#{id},</if>
|
|
|
+ <if test="licenceNo != null">#{licenceNo},</if>
|
|
|
+ <if test="customerName != null">#{customerName},</if>
|
|
|
+ <if test="creditLevel != null">#{creditLevel},</if>
|
|
|
+ <if test="longitude != null">#{longitude},</if>
|
|
|
+ <if test="latitude != null">#{latitude},</if>
|
|
|
+ <if test="remark != null">#{remark},</if>
|
|
|
+ <if test="delFlag != null">#{delFlag},</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>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <update id="updateBussIllegalCreditCustomer" parameterType="BussIllegalCreditCustomer">
|
|
|
+ update buss_illegal_credit_customer
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
+ <if test="licenceNo != null">licence_no = #{licenceNo},</if>
|
|
|
+ <if test="customerName != null">customer_name = #{customerName},</if>
|
|
|
+ <if test="creditLevel != null">credit_level = #{creditLevel},</if>
|
|
|
+ <if test="longitude != null">longitude = #{longitude},</if>
|
|
|
+ <if test="latitude != null">latitude = #{latitude},</if>
|
|
|
+ <if test="remark != null">remark = #{remark},</if>
|
|
|
+ <if test="delFlag != null">del_flag = #{delFlag},</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>
|
|
|
+ </trim>
|
|
|
+ where id = #{id}
|
|
|
+ </update>
|
|
|
+
|
|
|
+
|
|
|
+ <delete id="deleteBussIllegalCreditCustomerById" parameterType="String">
|
|
|
+ update buss_illegal_credit_customer set del_flag = '2' where id = #{id}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <delete id="deleteBussIllegalCreditCustomerByIds" parameterType="String">
|
|
|
+ update buss_illegal_credit_customer set del_flag = '2' where id in
|
|
|
+ <foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
+ #{id}
|
|
|
+ </foreach>
|
|
|
+ </delete>
|
|
|
+
|
|
|
+
|
|
|
+ <update id="cleanData" parameterType="map">
|
|
|
+ update buss_illegal_credit_customer set del_flag = '2' where del_flag = '0'
|
|
|
+ </update>
|
|
|
+
|
|
|
+
|
|
|
+ <!-- temp_interface_fn_sell 为interface_fn_sell 的临时表,每次导入违规户的时候,把这几个零售户的数据导入进去-->
|
|
|
+ <select id="queryNearOrderList" parameterType="map" resultType="map">
|
|
|
+ select sell_date, count(1) amount , sum(money_order) money_total from temp_interface_fn_sell where cust_id = #{custId}
|
|
|
+ group by sell_date
|
|
|
+ order by sell_date desc limit #{limit}
|
|
|
+ </select>
|
|
|
+</mapper>
|