| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142 |
- <?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.usoftchina.saas.document.mapper.CustomerkindMapper" >
- <resultMap id="BaseResultMap" type="com.usoftchina.saas.document.entities.Customerkind" >
- <id column="ck_id" property="id" jdbcType="INTEGER" />
- <result column="ck_name" property="ck_name" jdbcType="VARCHAR" />
- <result column="ck_recordid" property="ck_recordid" jdbcType="INTEGER" />
- <result column="ck_recorder" property="ck_recorder" jdbcType="VARCHAR" />
- <result column="ck_date" property="ck_date" jdbcType="TIMESTAMP" />
- <result column="companyId" property="companyId" jdbcType="INTEGER" />
- <result column="updaterId" property="updaterId" jdbcType="INTEGER" />
- <result column="updateTime" property="updateTime" jdbcType="TIMESTAMP" />
- </resultMap>
- <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long" >
- select
- <include refid="Base_Column_List" />
- from customerkind
- where ck_id = #{id}
- </select>
- <sql id="Base_Column_List" >
- ck_id, ck_name, ck_recordid, ck_recorder, ck_date, companyId, updaterId, updateTime
- </sql>
- <delete id="deleteByPrimaryKey" parameterType="java.lang.Long" >
- delete from customerkind
- where ck_id = #{id}
- </delete>
- <insert id="insert" parameterType="com.usoftchina.saas.document.entities.Customerkind" >
- insert into customerkind (ck_name, ck_recordid,
- ck_recorder, ck_date, companyId,
- updaterId, updateTime)
- values (#{ck_name,jdbcType=VARCHAR}, #{ck_recordid,jdbcType=INTEGER},
- #{ck_recorder,jdbcType=VARCHAR}, #{ck_date,jdbcType=TIMESTAMP}, #{companyId,jdbcType=INTEGER},
- #{updaterId,jdbcType=INTEGER}, #{updateTime,jdbcType=TIMESTAMP})
- </insert>
- <insert id="insertSelective" parameterType="com.usoftchina.saas.document.entities.Customerkind" >
- insert into customerkind
- <trim prefix="(" suffix=")" suffixOverrides="," >
- <if test="ck_name != null" >
- ck_name,
- </if>
- <if test="ck_recordid != null" >
- ck_recordid,
- </if>
- <if test="ck_recorder != null" >
- ck_recorder,
- </if>
- <if test="ck_date != null" >
- ck_date,
- </if>
- <if test="companyId != null" >
- companyId,
- </if>
- <if test="updaterId != null" >
- updaterId,
- </if>
- <if test="updateTime != null" >
- updateTime,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides="," >
- <if test="ck_name != null" >
- #{ck_name,jdbcType=VARCHAR},
- </if>
- <if test="ck_recordid != null" >
- #{ck_recordid,jdbcType=INTEGER},
- </if>
- <if test="ck_recorder != null" >
- #{ck_recorder,jdbcType=VARCHAR},
- </if>
- <if test="ck_date != null" >
- #{ck_date,jdbcType=TIMESTAMP},
- </if>
- <if test="companyId != null" >
- #{companyId,jdbcType=INTEGER},
- </if>
- <if test="updaterId != null" >
- #{updaterId,jdbcType=INTEGER},
- </if>
- <if test="updateTime != null" >
- #{updateTime,jdbcType=TIMESTAMP},
- </if>
- </trim>
- </insert>
- <update id="updateByPrimaryKeySelective" parameterType="com.usoftchina.saas.document.entities.Customerkind" >
- update customerkind
- <set >
- <if test="ck_name != null" >
- ck_name = #{ck_name,jdbcType=VARCHAR},
- </if>
- <if test="ck_recordid != null" >
- ck_recordid = #{ck_recordid,jdbcType=INTEGER},
- </if>
- <if test="ck_recorder != null" >
- ck_recorder = #{ck_recorder,jdbcType=VARCHAR},
- </if>
- <if test="ck_date != null" >
- ck_date = #{ck_date,jdbcType=TIMESTAMP},
- </if>
- <if test="companyId != null" >
- companyId = #{companyId,jdbcType=INTEGER},
- </if>
- <if test="updaterId != null" >
- updaterId = #{updaterId,jdbcType=INTEGER},
- </if>
- <if test="updateTime != null" >
- updateTime = #{updateTime,jdbcType=TIMESTAMP},
- </if>
- </set>
- where ck_id = #{id}
- </update>
- <update id="updateByPrimaryKey" parameterType="com.usoftchina.saas.document.entities.Customerkind" >
- update customerkind
- set ck_name = #{ck_name,jdbcType=VARCHAR},
- ck_recordid = #{ck_recordid,jdbcType=INTEGER},
- ck_recorder = #{ck_recorder,jdbcType=VARCHAR},
- ck_date = #{ck_date,jdbcType=TIMESTAMP},
- companyId = #{companyId,jdbcType=INTEGER},
- updaterId = #{updaterId,jdbcType=INTEGER},
- updateTime = #{updateTime,jdbcType=TIMESTAMP}
- where ck_id = #{id}
- </update>
- <select id="selectAll" resultMap="BaseResultMap">
- SELECT * FROM CUSTOMERKIND
- </select>
- <select id="getCombo" resultType="com.usoftchina.saas.commons.dto.ComboDTO">
- SELECT ck_name display,ck_name value FROM CUSTOMERKIND WHERE COMPANYID=#{companyId}
- </select>
- <select id="selectCountByName" resultType="int">
- SELECT count(*) FROM CUSTOMERKIND
- <where>
- <if test="name!=null">
- and CK_NAME=#{name}
- </if>
- <if test="companyId!=0 and companyId!=null">
- and companyId=#{companyId}
- </if>
- <if test="id!=0 and id != null">
- and ck_id != #{id}
- </if>
- </where>
- </select>
- </mapper>
|