123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213 |
- <?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.zcxk.smartcity.data.access.dao.CustomerMapper">
- <resultMap id="BaseResultMap" type="com.zcxk.smartcity.data.access.entity.Customer">
- <!--@mbg.generated-->
- <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="remark" jdbcType="VARCHAR" property="remark" />
- <result column="status" jdbcType="INTEGER" property="status" />
- <result column="customer_org_id" jdbcType="INTEGER" property="customerOrgId" />
- <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="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" />
- </resultMap>
- <sql id="Base_Column_List">
- <!--@mbg.generated-->
- id, site_id, customer_name, customer_phone, customer_contact_person, remark, `status`,
- customer_org_id, push_url, customer_no, token, date_create, date_update, create_by,
- update_by
- </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>
- <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.zcxk.smartcity.data.access.entity.Customer" useGeneratedKeys="true">
- <!--@mbg.generated-->
- insert into sc_customer (site_id, customer_name, customer_phone,
- customer_contact_person, remark, `status`,
- customer_org_id, push_url, customer_no,
- token, date_create, date_update,
- create_by, update_by)
- values (#{siteId,jdbcType=INTEGER}, #{customerName,jdbcType=VARCHAR}, #{customerPhone,jdbcType=VARCHAR},
- #{customerContactPerson,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER},
- #{customerOrgId,jdbcType=INTEGER}, #{pushUrl,jdbcType=VARCHAR}, #{customerNo,jdbcType=VARCHAR},
- #{token,jdbcType=VARCHAR}, #{dateCreate,jdbcType=TIMESTAMP}, #{dateUpdate,jdbcType=TIMESTAMP},
- #{createBy,jdbcType=VARCHAR}, #{updateBy,jdbcType=VARCHAR})
- </insert>
- <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.zcxk.smartcity.data.access.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="remark != null">
- remark,
- </if>
- <if test="status != null">
- `status`,
- </if>
- <if test="customerOrgId != null">
- customer_org_id,
- </if>
- <if test="pushUrl != null">
- push_url,
- </if>
- <if test="customerNo != null">
- customer_no,
- </if>
- <if test="token != null">
- token,
- </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>
- </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="remark != null">
- #{remark,jdbcType=VARCHAR},
- </if>
- <if test="status != null">
- #{status,jdbcType=INTEGER},
- </if>
- <if test="customerOrgId != null">
- #{customerOrgId,jdbcType=INTEGER},
- </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="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>
- </trim>
- </insert>
- <update id="updateByPrimaryKeySelective" parameterType="com.zcxk.smartcity.data.access.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="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="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="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>
- </set>
- where id = #{id,jdbcType=INTEGER}
- </update>
- <update id="updateByPrimaryKey" parameterType="com.zcxk.smartcity.data.access.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},
- remark = #{remark,jdbcType=VARCHAR},
- `status` = #{status,jdbcType=INTEGER},
- customer_org_id = #{customerOrgId,jdbcType=INTEGER},
- push_url = #{pushUrl,jdbcType=VARCHAR},
- customer_no = #{customerNo,jdbcType=VARCHAR},
- token = #{token,jdbcType=VARCHAR},
- date_create = #{dateCreate,jdbcType=TIMESTAMP},
- date_update = #{dateUpdate,jdbcType=TIMESTAMP},
- create_by = #{createBy,jdbcType=VARCHAR},
- update_by = #{updateBy,jdbcType=VARCHAR}
- where id = #{id,jdbcType=INTEGER}
- </update>
- </mapper>
|