|
@@ -0,0 +1,280 @@
|
|
|
|
+<?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.huaxu.zoniot.dao.CustomerMapper">
|
|
|
|
+ <resultMap id="BaseResultMap" type="com.huaxu.zoniot.entity.Customer">
|
|
|
|
+ <!--@mbg.generated-->
|
|
|
|
+ <!--@Table sc_customer-->
|
|
|
|
+ <id column="id" jdbcType="INTEGER" property="id" />
|
|
|
|
+ <result column="site_id" jdbcType="INTEGER" property="siteId" />
|
|
|
|
+ <result column="customer_name" jdbcType="VARCHAR" property="customerName" />
|
|
|
|
+ <result column="customer_phone" jdbcType="VARCHAR" property="customerPhone" />
|
|
|
|
+ <result column="customer_contact_person" jdbcType="VARCHAR" property="customerContactPerson" />
|
|
|
|
+ <result column="push_url" jdbcType="VARCHAR" property="pushUrl" />
|
|
|
|
+ <result column="customer_no" jdbcType="VARCHAR" property="customerNo" />
|
|
|
|
+ <result column="token" jdbcType="VARCHAR" property="token" />
|
|
|
|
+ <result column="remark" jdbcType="VARCHAR" property="remark" />
|
|
|
|
+ <result column="status" jdbcType="INTEGER" property="status" />
|
|
|
|
+ <result column="customer_org_id" jdbcType="INTEGER" property="customerOrgId" />
|
|
|
|
+ <result column="date_create" jdbcType="TIMESTAMP" property="dateCreate" />
|
|
|
|
+ <result column="date_update" jdbcType="TIMESTAMP" property="dateUpdate" />
|
|
|
|
+ <result column="create_by" jdbcType="VARCHAR" property="createBy" />
|
|
|
|
+ <result column="update_by" jdbcType="VARCHAR" property="updateBy" />
|
|
|
|
+ <result column="stage_type" jdbcType="INTEGER" property="stageType" />
|
|
|
|
+ <result column="picture_url" jdbcType="VARCHAR" property="pictureUrl" />
|
|
|
|
+ <result column="parent_id" jdbcType="INTEGER" property="parentId" />
|
|
|
|
+ <result column="children_num" jdbcType="INTEGER" property="childrenNum" />
|
|
|
|
+ <result column="pay_invoice_type" jdbcType="INTEGER" property="payInvoiceType" />
|
|
|
|
+ </resultMap>
|
|
|
|
+ <sql id="Base_Column_List">
|
|
|
|
+ <!--@mbg.generated-->
|
|
|
|
+ id, site_id, customer_name, customer_phone, customer_contact_person, push_url, customer_no,
|
|
|
|
+ token, remark, `status`, customer_org_id, date_create, date_update, create_by, update_by,
|
|
|
|
+ stage_type, picture_url, parent_id, children_num, pay_invoice_type
|
|
|
|
+ </sql>
|
|
|
|
+ <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
|
|
|
+ <!--@mbg.generated-->
|
|
|
|
+ select
|
|
|
|
+ <include refid="Base_Column_List" />
|
|
|
|
+ from sc_customer
|
|
|
|
+ where id = #{id,jdbcType=INTEGER}
|
|
|
|
+ </select>
|
|
|
|
+ <select id="selectByParentId" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
|
|
|
+ select
|
|
|
|
+ <include refid="Base_Column_List" />
|
|
|
|
+ from sc_customer
|
|
|
|
+ where parent_id = #{parentId,jdbcType=INTEGER}
|
|
|
|
+ and status = 1
|
|
|
|
+ </select>
|
|
|
|
+ <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
|
|
|
|
+ <!--@mbg.generated-->
|
|
|
|
+ delete from sc_customer
|
|
|
|
+ where id = #{id,jdbcType=INTEGER}
|
|
|
|
+ </delete>
|
|
|
|
+ <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.huaxu.zoniot.entity.Customer" useGeneratedKeys="true">
|
|
|
|
+ <!--@mbg.generated-->
|
|
|
|
+ insert into sc_customer (site_id, customer_name, customer_phone,
|
|
|
|
+ customer_contact_person, push_url, customer_no,
|
|
|
|
+ token, remark, `status`,
|
|
|
|
+ customer_org_id, date_create, date_update,
|
|
|
|
+ create_by, update_by, stage_type,
|
|
|
|
+ picture_url, parent_id, children_num,
|
|
|
|
+ pay_invoice_type)
|
|
|
|
+ values (#{siteId,jdbcType=INTEGER}, #{customerName,jdbcType=VARCHAR}, #{customerPhone,jdbcType=VARCHAR},
|
|
|
|
+ #{customerContactPerson,jdbcType=VARCHAR}, #{pushUrl,jdbcType=VARCHAR}, #{customerNo,jdbcType=VARCHAR},
|
|
|
|
+ #{token,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER},
|
|
|
|
+ #{customerOrgId,jdbcType=INTEGER}, #{dateCreate,jdbcType=TIMESTAMP}, #{dateUpdate,jdbcType=TIMESTAMP},
|
|
|
|
+ #{createBy,jdbcType=VARCHAR}, #{updateBy,jdbcType=VARCHAR}, #{stageType,jdbcType=INTEGER},
|
|
|
|
+ #{pictureUrl,jdbcType=VARCHAR}, #{parentId,jdbcType=INTEGER}, #{childrenNum,jdbcType=INTEGER},
|
|
|
|
+ #{payInvoiceType,jdbcType=INTEGER})
|
|
|
|
+ </insert>
|
|
|
|
+ <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.huaxu.zoniot.entity.Customer" useGeneratedKeys="true">
|
|
|
|
+ <!--@mbg.generated-->
|
|
|
|
+ insert into sc_customer
|
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
+ <if test="siteId != null">
|
|
|
|
+ site_id,
|
|
|
|
+ </if>
|
|
|
|
+ <if test="customerName != null">
|
|
|
|
+ customer_name,
|
|
|
|
+ </if>
|
|
|
|
+ <if test="customerPhone != null">
|
|
|
|
+ customer_phone,
|
|
|
|
+ </if>
|
|
|
|
+ <if test="customerContactPerson != null">
|
|
|
|
+ customer_contact_person,
|
|
|
|
+ </if>
|
|
|
|
+ <if test="pushUrl != null">
|
|
|
|
+ push_url,
|
|
|
|
+ </if>
|
|
|
|
+ <if test="customerNo != null">
|
|
|
|
+ customer_no,
|
|
|
|
+ </if>
|
|
|
|
+ <if test="token != null">
|
|
|
|
+ token,
|
|
|
|
+ </if>
|
|
|
|
+ <if test="remark != null">
|
|
|
|
+ remark,
|
|
|
|
+ </if>
|
|
|
|
+ <if test="status != null">
|
|
|
|
+ `status`,
|
|
|
|
+ </if>
|
|
|
|
+ <if test="customerOrgId != null">
|
|
|
|
+ customer_org_id,
|
|
|
|
+ </if>
|
|
|
|
+ <if test="dateCreate != null">
|
|
|
|
+ date_create,
|
|
|
|
+ </if>
|
|
|
|
+ <if test="dateUpdate != null">
|
|
|
|
+ date_update,
|
|
|
|
+ </if>
|
|
|
|
+ <if test="createBy != null">
|
|
|
|
+ create_by,
|
|
|
|
+ </if>
|
|
|
|
+ <if test="updateBy != null">
|
|
|
|
+ update_by,
|
|
|
|
+ </if>
|
|
|
|
+ <if test="stageType != null">
|
|
|
|
+ stage_type,
|
|
|
|
+ </if>
|
|
|
|
+ <if test="pictureUrl != null">
|
|
|
|
+ picture_url,
|
|
|
|
+ </if>
|
|
|
|
+ <if test="parentId != null">
|
|
|
|
+ parent_id,
|
|
|
|
+ </if>
|
|
|
|
+ <if test="childrenNum != null">
|
|
|
|
+ children_num,
|
|
|
|
+ </if>
|
|
|
|
+ <if test="payInvoiceType != null">
|
|
|
|
+ pay_invoice_type,
|
|
|
|
+ </if>
|
|
|
|
+ </trim>
|
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
|
+ <if test="siteId != null">
|
|
|
|
+ #{siteId,jdbcType=INTEGER},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="customerName != null">
|
|
|
|
+ #{customerName,jdbcType=VARCHAR},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="customerPhone != null">
|
|
|
|
+ #{customerPhone,jdbcType=VARCHAR},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="customerContactPerson != null">
|
|
|
|
+ #{customerContactPerson,jdbcType=VARCHAR},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="pushUrl != null">
|
|
|
|
+ #{pushUrl,jdbcType=VARCHAR},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="customerNo != null">
|
|
|
|
+ #{customerNo,jdbcType=VARCHAR},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="token != null">
|
|
|
|
+ #{token,jdbcType=VARCHAR},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="remark != null">
|
|
|
|
+ #{remark,jdbcType=VARCHAR},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="status != null">
|
|
|
|
+ #{status,jdbcType=INTEGER},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="customerOrgId != null">
|
|
|
|
+ #{customerOrgId,jdbcType=INTEGER},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="dateCreate != null">
|
|
|
|
+ #{dateCreate,jdbcType=TIMESTAMP},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="dateUpdate != null">
|
|
|
|
+ #{dateUpdate,jdbcType=TIMESTAMP},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="createBy != null">
|
|
|
|
+ #{createBy,jdbcType=VARCHAR},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="updateBy != null">
|
|
|
|
+ #{updateBy,jdbcType=VARCHAR},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="stageType != null">
|
|
|
|
+ #{stageType,jdbcType=INTEGER},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="pictureUrl != null">
|
|
|
|
+ #{pictureUrl,jdbcType=VARCHAR},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="parentId != null">
|
|
|
|
+ #{parentId,jdbcType=INTEGER},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="childrenNum != null">
|
|
|
|
+ #{childrenNum,jdbcType=INTEGER},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="payInvoiceType != null">
|
|
|
|
+ #{payInvoiceType,jdbcType=INTEGER},
|
|
|
|
+ </if>
|
|
|
|
+ </trim>
|
|
|
|
+ </insert>
|
|
|
|
+ <update id="updateByPrimaryKeySelective" parameterType="com.huaxu.zoniot.entity.Customer">
|
|
|
|
+ <!--@mbg.generated-->
|
|
|
|
+ update sc_customer
|
|
|
|
+ <set>
|
|
|
|
+ <if test="siteId != null">
|
|
|
|
+ site_id = #{siteId,jdbcType=INTEGER},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="customerName != null">
|
|
|
|
+ customer_name = #{customerName,jdbcType=VARCHAR},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="customerPhone != null">
|
|
|
|
+ customer_phone = #{customerPhone,jdbcType=VARCHAR},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="customerContactPerson != null">
|
|
|
|
+ customer_contact_person = #{customerContactPerson,jdbcType=VARCHAR},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="pushUrl != null">
|
|
|
|
+ push_url = #{pushUrl,jdbcType=VARCHAR},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="customerNo != null">
|
|
|
|
+ customer_no = #{customerNo,jdbcType=VARCHAR},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="token != null">
|
|
|
|
+ token = #{token,jdbcType=VARCHAR},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="remark != null">
|
|
|
|
+ remark = #{remark,jdbcType=VARCHAR},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="status != null">
|
|
|
|
+ `status` = #{status,jdbcType=INTEGER},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="customerOrgId != null">
|
|
|
|
+ customer_org_id = #{customerOrgId,jdbcType=INTEGER},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="dateCreate != null">
|
|
|
|
+ date_create = #{dateCreate,jdbcType=TIMESTAMP},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="dateUpdate != null">
|
|
|
|
+ date_update = #{dateUpdate,jdbcType=TIMESTAMP},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="createBy != null">
|
|
|
|
+ create_by = #{createBy,jdbcType=VARCHAR},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="updateBy != null">
|
|
|
|
+ update_by = #{updateBy,jdbcType=VARCHAR},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="stageType != null">
|
|
|
|
+ stage_type = #{stageType,jdbcType=INTEGER},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="pictureUrl != null">
|
|
|
|
+ picture_url = #{pictureUrl,jdbcType=VARCHAR},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="parentId != null">
|
|
|
|
+ parent_id = #{parentId,jdbcType=INTEGER},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="childrenNum != null">
|
|
|
|
+ children_num = #{childrenNum,jdbcType=INTEGER},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="payInvoiceType != null">
|
|
|
|
+ pay_invoice_type = #{payInvoiceType,jdbcType=INTEGER},
|
|
|
|
+ </if>
|
|
|
|
+ </set>
|
|
|
|
+ where id = #{id,jdbcType=INTEGER}
|
|
|
|
+ </update>
|
|
|
|
+ <update id="updateByPrimaryKey" parameterType="com.huaxu.zoniot.entity.Customer">
|
|
|
|
+ <!--@mbg.generated-->
|
|
|
|
+ update sc_customer
|
|
|
|
+ set site_id = #{siteId,jdbcType=INTEGER},
|
|
|
|
+ customer_name = #{customerName,jdbcType=VARCHAR},
|
|
|
|
+ customer_phone = #{customerPhone,jdbcType=VARCHAR},
|
|
|
|
+ customer_contact_person = #{customerContactPerson,jdbcType=VARCHAR},
|
|
|
|
+ push_url = #{pushUrl,jdbcType=VARCHAR},
|
|
|
|
+ customer_no = #{customerNo,jdbcType=VARCHAR},
|
|
|
|
+ token = #{token,jdbcType=VARCHAR},
|
|
|
|
+ remark = #{remark,jdbcType=VARCHAR},
|
|
|
|
+ `status` = #{status,jdbcType=INTEGER},
|
|
|
|
+ customer_org_id = #{customerOrgId,jdbcType=INTEGER},
|
|
|
|
+ date_create = #{dateCreate,jdbcType=TIMESTAMP},
|
|
|
|
+ date_update = #{dateUpdate,jdbcType=TIMESTAMP},
|
|
|
|
+ create_by = #{createBy,jdbcType=VARCHAR},
|
|
|
|
+ update_by = #{updateBy,jdbcType=VARCHAR},
|
|
|
|
+ stage_type = #{stageType,jdbcType=INTEGER},
|
|
|
|
+ picture_url = #{pictureUrl,jdbcType=VARCHAR},
|
|
|
|
+ parent_id = #{parentId,jdbcType=INTEGER},
|
|
|
|
+ children_num = #{childrenNum,jdbcType=INTEGER},
|
|
|
|
+ pay_invoice_type = #{payInvoiceType,jdbcType=INTEGER}
|
|
|
|
+ where id = #{id,jdbcType=INTEGER}
|
|
|
|
+ </update>
|
|
|
|
+</mapper>
|