123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396 |
- <?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.lote.wms.user.customer.dao.CustomerContactMapper" >
- <resultMap id="BaseResultMap" type="com.lote.wms.user.customer.entity.CustomerContact" >
- <id column="id" property="id" jdbcType="VARCHAR" />
- <result column="customer_id" property="customerId" jdbcType="VARCHAR" />
- <result column="customer_code" property="customerCode" jdbcType="VARCHAR" />
- <result column="name" property="name" jdbcType="VARCHAR" />
- <result column="address_line1" property="addressLine1" jdbcType="VARCHAR" />
- <result column="address_line2" property="addressLine2" jdbcType="VARCHAR" />
- <result column="province" property="province" jdbcType="VARCHAR" />
- <result column="city" property="city" jdbcType="VARCHAR" />
- <result column="county" property="county" jdbcType="VARCHAR" />
- <result column="postal_code" property="postalCode" jdbcType="VARCHAR" />
- <result column="country_code" property="countryCode" jdbcType="VARCHAR" />
- <result column="country_name" property="countryName" jdbcType="VARCHAR" />
- <result column="email" property="email" jdbcType="VARCHAR" />
- <result column="mobile_number" property="mobileNumber" jdbcType="VARCHAR" />
- <result column="phone_number" property="phoneNumber" jdbcType="VARCHAR" />
- <result column="identity_number" property="identityNumber" jdbcType="VARCHAR" />
- <result column="created_time" property="createdTime" jdbcType="TIMESTAMP" />
- <result column="created_by_user_id" property="createdByUserId" jdbcType="VARCHAR" />
- <result column="created_by_user_code" property="createdByUserCode" jdbcType="VARCHAR" />
- <result column="update_time" property="updateTime" jdbcType="TIMESTAMP" />
- <result column="update_by_user_id" property="updateByUserId" jdbcType="VARCHAR" />
- <result column="update_by_user_code" property="updateByUserCode" jdbcType="VARCHAR" />
- <result column="extend1" property="extend1" jdbcType="VARCHAR" />
- <result column="extend2" property="extend2" jdbcType="VARCHAR" />
- <result column="attachment1_address" property="attachment1Address" jdbcType="VARCHAR" />
- <result column="attachment1_remark" property="attachment1Remark" jdbcType="VARCHAR" />
- <result column="attachment2_address" property="attachment2Address" jdbcType="VARCHAR" />
- <result column="attachment2_remark" property="attachment2Remark" jdbcType="VARCHAR" />
- <result column="attachment3_address" property="attachment3Address" jdbcType="VARCHAR" />
- <result column="attachment3_remark" property="attachment3Remark" jdbcType="VARCHAR" />
- </resultMap>
- <sql id="Condition_Where_Clause" >
- <where >
- <foreach collection="oredCriteria" item="criteria" separator="or" >
- <if test="criteria.valid" >
- <trim prefix="(" suffix=")" prefixOverrides="and" >
- <foreach collection="criteria.criteria" item="criterion" >
- <choose >
- <when test="criterion.noValue" >
- and ${criterion.condition}
- </when>
- <when test="criterion.singleValue" >
- and ${criterion.condition} #{criterion.value}
- </when>
- <when test="criterion.betweenValue" >
- and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
- </when>
- <when test="criterion.listValue" >
- and ${criterion.condition}
- <foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
- #{listItem}
- </foreach>
- </when>
- </choose>
- </foreach>
- </trim>
- </if>
- </foreach>
- </where>
- </sql>
- <sql id="Base_Column_List" >
- id, customer_id, customer_code, name, address_line1, address_line2, province, city,
- county, postal_code, country_code, country_name, email, mobile_number, phone_number,
- identity_number, created_time, created_by_user_id, created_by_user_code, update_time,
- update_by_user_id, update_by_user_code, extend1, extend2, attachment1_address, attachment1_remark,
- attachment2_address, attachment2_remark, attachment3_address, attachment3_remark
- </sql>
- <select id="selectByConditionList" resultMap="BaseResultMap" parameterType="com.lote.wms.user.customer.entity.CustomerContactCriteria" >
- select
- <if test="distinct" >
- distinct
- </if>
- <include refid="Base_Column_List" />
- from u_customer_contact
- <if test="_parameter != null" >
- <include refid="Condition_Where_Clause" />
- </if>
- <if test="orderByClause != null" >
- order by ${orderByClause}
- </if>
- <if test="limit>0" >
- limit ${start} , ${limit}
- </if>
- </select>
- <select id="selectAll" resultMap="BaseResultMap">
- select
- <include refid="Base_Column_List" />
- from u_customer_contact
- </select>
- <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
- select
- <include refid="Base_Column_List" />
- from u_customer_contact
- where id = #{id,jdbcType=VARCHAR}
- </select>
- <delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
- delete from u_customer_contact
- where id = #{id,jdbcType=VARCHAR}
- </delete>
- <delete id="deleteByCondition" parameterType="com.lote.wms.user.customer.entity.CustomerContactCriteria" >
- delete from u_customer_contact
- <if test="_parameter != null" >
- <include refid="Condition_Where_Clause" />
- </if>
- </delete>
- <insert id="insertSelective" parameterType="com.lote.wms.user.customer.entity.CustomerContact" >
- insert into u_customer_contact
- <trim prefix="(" suffix=")" suffixOverrides="," >
- <if test="id != null" >
- id,
- </if>
- <if test="customerId != null" >
- customer_id,
- </if>
- <if test="customerCode != null" >
- customer_code,
- </if>
- <if test="name != null" >
- name,
- </if>
- <if test="addressLine1 != null" >
- address_line1,
- </if>
- <if test="addressLine2 != null" >
- address_line2,
- </if>
- <if test="province != null" >
- province,
- </if>
- <if test="city != null" >
- city,
- </if>
- <if test="county != null" >
- county,
- </if>
- <if test="postalCode != null" >
- postal_code,
- </if>
- <if test="countryCode != null" >
- country_code,
- </if>
- <if test="countryName != null" >
- country_name,
- </if>
- <if test="email != null" >
- email,
- </if>
- <if test="mobileNumber != null" >
- mobile_number,
- </if>
- <if test="phoneNumber != null" >
- phone_number,
- </if>
- <if test="identityNumber != null" >
- identity_number,
- </if>
- <if test="createdTime != null" >
- created_time,
- </if>
- <if test="createdByUserId != null" >
- created_by_user_id,
- </if>
- <if test="createdByUserCode != null" >
- created_by_user_code,
- </if>
- <if test="updateTime != null" >
- update_time,
- </if>
- <if test="updateByUserId != null" >
- update_by_user_id,
- </if>
- <if test="updateByUserCode != null" >
- update_by_user_code,
- </if>
- <if test="extend1 != null" >
- extend1,
- </if>
- <if test="extend2 != null" >
- extend2,
- </if>
- <if test="attachment1Address != null" >
- attachment1_address,
- </if>
- <if test="attachment1Remark != null" >
- attachment1_remark,
- </if>
- <if test="attachment2Address != null" >
- attachment2_address,
- </if>
- <if test="attachment2Remark != null" >
- attachment2_remark,
- </if>
- <if test="attachment3Address != null" >
- attachment3_address,
- </if>
- <if test="attachment3Remark != null" >
- attachment3_remark,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides="," >
- <if test="id != null" >
- #{id,jdbcType=VARCHAR},
- </if>
- <if test="customerId != null" >
- #{customerId,jdbcType=VARCHAR},
- </if>
- <if test="customerCode != null" >
- #{customerCode,jdbcType=VARCHAR},
- </if>
- <if test="name != null" >
- #{name,jdbcType=VARCHAR},
- </if>
- <if test="addressLine1 != null" >
- #{addressLine1,jdbcType=VARCHAR},
- </if>
- <if test="addressLine2 != null" >
- #{addressLine2,jdbcType=VARCHAR},
- </if>
- <if test="province != null" >
- #{province,jdbcType=VARCHAR},
- </if>
- <if test="city != null" >
- #{city,jdbcType=VARCHAR},
- </if>
- <if test="county != null" >
- #{county,jdbcType=VARCHAR},
- </if>
- <if test="postalCode != null" >
- #{postalCode,jdbcType=VARCHAR},
- </if>
- <if test="countryCode != null" >
- #{countryCode,jdbcType=VARCHAR},
- </if>
- <if test="countryName != null" >
- #{countryName,jdbcType=VARCHAR},
- </if>
- <if test="email != null" >
- #{email,jdbcType=VARCHAR},
- </if>
- <if test="mobileNumber != null" >
- #{mobileNumber,jdbcType=VARCHAR},
- </if>
- <if test="phoneNumber != null" >
- #{phoneNumber,jdbcType=VARCHAR},
- </if>
- <if test="identityNumber != null" >
- #{identityNumber,jdbcType=VARCHAR},
- </if>
- <if test="createdTime != null" >
- #{createdTime,jdbcType=TIMESTAMP},
- </if>
- <if test="createdByUserId != null" >
- #{createdByUserId,jdbcType=VARCHAR},
- </if>
- <if test="createdByUserCode != null" >
- #{createdByUserCode,jdbcType=VARCHAR},
- </if>
- <if test="updateTime != null" >
- #{updateTime,jdbcType=TIMESTAMP},
- </if>
- <if test="updateByUserId != null" >
- #{updateByUserId,jdbcType=VARCHAR},
- </if>
- <if test="updateByUserCode != null" >
- #{updateByUserCode,jdbcType=VARCHAR},
- </if>
- <if test="extend1 != null" >
- #{extend1,jdbcType=VARCHAR},
- </if>
- <if test="extend2 != null" >
- #{extend2,jdbcType=VARCHAR},
- </if>
- <if test="attachment1Address != null" >
- #{attachment1Address,jdbcType=VARCHAR},
- </if>
- <if test="attachment1Remark != null" >
- #{attachment1Remark,jdbcType=VARCHAR},
- </if>
- <if test="attachment2Address != null" >
- #{attachment2Address,jdbcType=VARCHAR},
- </if>
- <if test="attachment2Remark != null" >
- #{attachment2Remark,jdbcType=VARCHAR},
- </if>
- <if test="attachment3Address != null" >
- #{attachment3Address,jdbcType=VARCHAR},
- </if>
- <if test="attachment3Remark != null" >
- #{attachment3Remark,jdbcType=VARCHAR},
- </if>
- </trim>
- </insert>
- <select id="countByCondition" parameterType="com.lote.wms.user.customer.entity.CustomerContactCriteria" resultType="java.lang.Integer" >
- select count(*) from u_customer_contact
- <if test="_parameter != null" >
- <include refid="Condition_Where_Clause" />
- </if>
- </select>
- <update id="updateByPrimaryKeySelective" parameterType="com.lote.wms.user.customer.entity.CustomerContact" >
- update u_customer_contact
- <set >
- <if test="customerId != null" >
- customer_id = #{customerId,jdbcType=VARCHAR},
- </if>
- <if test="customerCode != null" >
- customer_code = #{customerCode,jdbcType=VARCHAR},
- </if>
- <if test="name != null" >
- name = #{name,jdbcType=VARCHAR},
- </if>
- <if test="addressLine1 != null" >
- address_line1 = #{addressLine1,jdbcType=VARCHAR},
- </if>
- <if test="addressLine2 != null" >
- address_line2 = #{addressLine2,jdbcType=VARCHAR},
- </if>
- <if test="province != null" >
- province = #{province,jdbcType=VARCHAR},
- </if>
- <if test="city != null" >
- city = #{city,jdbcType=VARCHAR},
- </if>
- <if test="county != null" >
- county = #{county,jdbcType=VARCHAR},
- </if>
- <if test="postalCode != null" >
- postal_code = #{postalCode,jdbcType=VARCHAR},
- </if>
- <if test="countryCode != null" >
- country_code = #{countryCode,jdbcType=VARCHAR},
- </if>
- <if test="countryName != null" >
- country_name = #{countryName,jdbcType=VARCHAR},
- </if>
- <if test="email != null" >
- email = #{email,jdbcType=VARCHAR},
- </if>
- <if test="mobileNumber != null" >
- mobile_number = #{mobileNumber,jdbcType=VARCHAR},
- </if>
- <if test="phoneNumber != null" >
- phone_number = #{phoneNumber,jdbcType=VARCHAR},
- </if>
- <if test="identityNumber != null" >
- identity_number = #{identityNumber,jdbcType=VARCHAR},
- </if>
- <if test="createdTime != null" >
- created_time = #{createdTime,jdbcType=TIMESTAMP},
- </if>
- <if test="createdByUserId != null" >
- created_by_user_id = #{createdByUserId,jdbcType=VARCHAR},
- </if>
- <if test="createdByUserCode != null" >
- created_by_user_code = #{createdByUserCode,jdbcType=VARCHAR},
- </if>
- <if test="updateTime != null" >
- update_time = #{updateTime,jdbcType=TIMESTAMP},
- </if>
- <if test="updateByUserId != null" >
- update_by_user_id = #{updateByUserId,jdbcType=VARCHAR},
- </if>
- <if test="updateByUserCode != null" >
- update_by_user_code = #{updateByUserCode,jdbcType=VARCHAR},
- </if>
- <if test="extend1 != null" >
- extend1 = #{extend1,jdbcType=VARCHAR},
- </if>
- <if test="extend2 != null" >
- extend2 = #{extend2,jdbcType=VARCHAR},
- </if>
- <if test="attachment1Address != null" >
- attachment1_address = #{attachment1Address,jdbcType=VARCHAR},
- </if>
- <if test="attachment1Remark != null" >
- attachment1_remark = #{attachment1Remark,jdbcType=VARCHAR},
- </if>
- <if test="attachment2Address != null" >
- attachment2_address = #{attachment2Address,jdbcType=VARCHAR},
- </if>
- <if test="attachment2Remark != null" >
- attachment2_remark = #{attachment2Remark,jdbcType=VARCHAR},
- </if>
- <if test="attachment3Address != null" >
- attachment3_address = #{attachment3Address,jdbcType=VARCHAR},
- </if>
- <if test="attachment3Remark != null" >
- attachment3_remark = #{attachment3Remark,jdbcType=VARCHAR},
- </if>
- </set>
- where id = #{id,jdbcType=VARCHAR}
- </update>
- </mapper>
|