CasementMapper.xml 13.7 KB
<?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.canrd.patent.dal.mapper.CasementMapper">
  <resultMap id="BaseResultMap" type="com.canrd.patent.dal.model.Casement">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="name" jdbcType="VARCHAR" property="name" />
    <result column="case_sn" jdbcType="VARCHAR" property="caseSn" />
    <result column="case_type" jdbcType="VARCHAR" property="caseType" />
    <result column="service_type" jdbcType="VARCHAR" property="serviceType" />
    <result column="paid_type" jdbcType="VARCHAR" property="paidType" />
    <result column="reduce_type" jdbcType="VARCHAR" property="reduceType" />
    <result column="expense" jdbcType="BIGINT" property="expense" />
    <result column="case_status" jdbcType="VARCHAR" property="caseStatus" />
    <result column="member_id" jdbcType="VARCHAR" property="memberId" />
    <result column="create_date" jdbcType="TIMESTAMP" property="createDate" />
    <result column="update_date" jdbcType="TIMESTAMP" property="updateDate" />
  </resultMap>
  <sql id="Example_Where_Clause">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    <where>
      <foreach collection="oredCriteria" item="criteria" separator="or">
        <if test="criteria.valid">
          <trim prefix="(" prefixOverrides="and" suffix=")">
            <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 close=")" collection="criterion.value" item="listItem" open="(" separator=",">
                    #{listItem}
                  </foreach>
                </when>
              </choose>
            </foreach>
          </trim>
        </if>
      </foreach>
    </where>
  </sql>
  <sql id="Update_By_Example_Where_Clause">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    <where>
      <foreach collection="example.oredCriteria" item="criteria" separator="or">
        <if test="criteria.valid">
          <trim prefix="(" prefixOverrides="and" suffix=")">
            <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 close=")" collection="criterion.value" item="listItem" open="(" separator=",">
                    #{listItem}
                  </foreach>
                </when>
              </choose>
            </foreach>
          </trim>
        </if>
      </foreach>
    </where>
  </sql>
  <sql id="Base_Column_List">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    id, name, case_sn, case_type, service_type, paid_type, reduce_type, expense, case_status, 
    member_id, create_date, update_date
  </sql>
  <select id="selectByExample" parameterType="com.canrd.patent.dal.model.CasementExample" resultMap="BaseResultMap">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    from casement
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null">
      order by ${orderByClause}
    </if>
  </select>
  <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    select 
    <include refid="Base_Column_List" />
    from casement
    where id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    delete from casement
    where id = #{id,jdbcType=BIGINT}
  </delete>
  <delete id="deleteByExample" parameterType="com.canrd.patent.dal.model.CasementExample">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    delete from casement
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="com.canrd.patent.dal.model.Casement">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into casement (name, case_sn, case_type, 
      service_type, paid_type, reduce_type, 
      expense, case_status, member_id, 
      create_date, update_date)
    values (#{name,jdbcType=VARCHAR}, #{caseSn,jdbcType=VARCHAR}, #{caseType,jdbcType=VARCHAR}, 
      #{serviceType,jdbcType=VARCHAR}, #{paidType,jdbcType=VARCHAR}, #{reduceType,jdbcType=VARCHAR}, 
      #{expense,jdbcType=BIGINT}, #{caseStatus,jdbcType=VARCHAR}, #{memberId,jdbcType=VARCHAR}, 
      #{createDate,jdbcType=TIMESTAMP}, #{updateDate,jdbcType=TIMESTAMP})
  </insert>
  <insert id="insertSelective" parameterType="com.canrd.patent.dal.model.Casement">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into casement
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="name != null">
        name,
      </if>
      <if test="caseSn != null">
        case_sn,
      </if>
      <if test="caseType != null">
        case_type,
      </if>
      <if test="serviceType != null">
        service_type,
      </if>
      <if test="paidType != null">
        paid_type,
      </if>
      <if test="reduceType != null">
        reduce_type,
      </if>
      <if test="expense != null">
        expense,
      </if>
      <if test="caseStatus != null">
        case_status,
      </if>
      <if test="memberId != null">
        member_id,
      </if>
      <if test="createDate != null">
        create_date,
      </if>
      <if test="updateDate != null">
        update_date,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="name != null">
        #{name,jdbcType=VARCHAR},
      </if>
      <if test="caseSn != null">
        #{caseSn,jdbcType=VARCHAR},
      </if>
      <if test="caseType != null">
        #{caseType,jdbcType=VARCHAR},
      </if>
      <if test="serviceType != null">
        #{serviceType,jdbcType=VARCHAR},
      </if>
      <if test="paidType != null">
        #{paidType,jdbcType=VARCHAR},
      </if>
      <if test="reduceType != null">
        #{reduceType,jdbcType=VARCHAR},
      </if>
      <if test="expense != null">
        #{expense,jdbcType=BIGINT},
      </if>
      <if test="caseStatus != null">
        #{caseStatus,jdbcType=VARCHAR},
      </if>
      <if test="memberId != null">
        #{memberId,jdbcType=VARCHAR},
      </if>
      <if test="createDate != null">
        #{createDate,jdbcType=TIMESTAMP},
      </if>
      <if test="updateDate != null">
        #{updateDate,jdbcType=TIMESTAMP},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="com.canrd.patent.dal.model.CasementExample" resultType="java.lang.Integer">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    select count(*) from casement
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    update casement
    <set>
      <if test="record.id != null">
        id = #{record.id,jdbcType=BIGINT},
      </if>
      <if test="record.name != null">
        name = #{record.name,jdbcType=VARCHAR},
      </if>
      <if test="record.caseSn != null">
        case_sn = #{record.caseSn,jdbcType=VARCHAR},
      </if>
      <if test="record.caseType != null">
        case_type = #{record.caseType,jdbcType=VARCHAR},
      </if>
      <if test="record.serviceType != null">
        service_type = #{record.serviceType,jdbcType=VARCHAR},
      </if>
      <if test="record.paidType != null">
        paid_type = #{record.paidType,jdbcType=VARCHAR},
      </if>
      <if test="record.reduceType != null">
        reduce_type = #{record.reduceType,jdbcType=VARCHAR},
      </if>
      <if test="record.expense != null">
        expense = #{record.expense,jdbcType=BIGINT},
      </if>
      <if test="record.caseStatus != null">
        case_status = #{record.caseStatus,jdbcType=VARCHAR},
      </if>
      <if test="record.memberId != null">
        member_id = #{record.memberId,jdbcType=VARCHAR},
      </if>
      <if test="record.createDate != null">
        create_date = #{record.createDate,jdbcType=TIMESTAMP},
      </if>
      <if test="record.updateDate != null">
        update_date = #{record.updateDate,jdbcType=TIMESTAMP},
      </if>
    </set>
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExample" parameterType="map">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    update casement
    set id = #{record.id,jdbcType=BIGINT},
      name = #{record.name,jdbcType=VARCHAR},
      case_sn = #{record.caseSn,jdbcType=VARCHAR},
      case_type = #{record.caseType,jdbcType=VARCHAR},
      service_type = #{record.serviceType,jdbcType=VARCHAR},
      paid_type = #{record.paidType,jdbcType=VARCHAR},
      reduce_type = #{record.reduceType,jdbcType=VARCHAR},
      expense = #{record.expense,jdbcType=BIGINT},
      case_status = #{record.caseStatus,jdbcType=VARCHAR},
      member_id = #{record.memberId,jdbcType=VARCHAR},
      create_date = #{record.createDate,jdbcType=TIMESTAMP},
      update_date = #{record.updateDate,jdbcType=TIMESTAMP}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="com.canrd.patent.dal.model.Casement">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    update casement
    <set>
      <if test="name != null">
        name = #{name,jdbcType=VARCHAR},
      </if>
      <if test="caseSn != null">
        case_sn = #{caseSn,jdbcType=VARCHAR},
      </if>
      <if test="caseType != null">
        case_type = #{caseType,jdbcType=VARCHAR},
      </if>
      <if test="serviceType != null">
        service_type = #{serviceType,jdbcType=VARCHAR},
      </if>
      <if test="paidType != null">
        paid_type = #{paidType,jdbcType=VARCHAR},
      </if>
      <if test="reduceType != null">
        reduce_type = #{reduceType,jdbcType=VARCHAR},
      </if>
      <if test="expense != null">
        expense = #{expense,jdbcType=BIGINT},
      </if>
      <if test="caseStatus != null">
        case_status = #{caseStatus,jdbcType=VARCHAR},
      </if>
      <if test="memberId != null">
        member_id = #{memberId,jdbcType=VARCHAR},
      </if>
      <if test="createDate != null">
        create_date = #{createDate,jdbcType=TIMESTAMP},
      </if>
      <if test="updateDate != null">
        update_date = #{updateDate,jdbcType=TIMESTAMP},
      </if>
    </set>
    where id = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.canrd.patent.dal.model.Casement">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    update casement
    set name = #{name,jdbcType=VARCHAR},
      case_sn = #{caseSn,jdbcType=VARCHAR},
      case_type = #{caseType,jdbcType=VARCHAR},
      service_type = #{serviceType,jdbcType=VARCHAR},
      paid_type = #{paidType,jdbcType=VARCHAR},
      reduce_type = #{reduceType,jdbcType=VARCHAR},
      expense = #{expense,jdbcType=BIGINT},
      case_status = #{caseStatus,jdbcType=VARCHAR},
      member_id = #{memberId,jdbcType=VARCHAR},
      create_date = #{createDate,jdbcType=TIMESTAMP},
      update_date = #{updateDate,jdbcType=TIMESTAMP}
    where id = #{id,jdbcType=BIGINT}
  </update>
</mapper>