TdBSettlementSerialMapper.xml 12.5 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.zteits.order.mapper.TdBSettlementSerialMapper">
  <resultMap id="BaseResultMap" type="com.zteits.order.domain.TdBSettlementSerial">
    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="settlement_month" jdbcType="VARCHAR" property="settlementMonth" />
    <result column="from_org_id" jdbcType="BIGINT" property="fromOrgId" />
    <result column="to_org_id" jdbcType="BIGINT" property="toOrgId" />
    <result column="settlement_total_fee" jdbcType="BIGINT" property="settlementTotalFee" />
    <result column="settlement_act_fee" jdbcType="BIGINT" property="settlementActFee" />
    <result column="settlement_state" jdbcType="INTEGER" property="settlementState" />
    <result column="op_emp_id" jdbcType="VARCHAR" property="opEmpId" />
    <result column="op_emp_name" jdbcType="VARCHAR" property="opEmpName" />
    <result column="create_date" jdbcType="TIMESTAMP" property="createDate" />
    <result column="data_state" jdbcType="INTEGER" property="dataState" />
    <result column="remark" jdbcType="VARCHAR" property="remark" />
  </resultMap>
  <sql id="Example_Where_Clause">
    <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">
    <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">
    id, settlement_month, from_org_id, to_org_id, settlement_total_fee, settlement_act_fee, 
    settlement_state, op_emp_id, op_emp_name, create_date, data_state, remark
  </sql>
  <select id="selectByExample" parameterType="com.zteits.order.domain.TdBSettlementSerialExample" resultMap="BaseResultMap">
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    from td_b_settlement_serial
    <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">
    select 
    <include refid="Base_Column_List" />
    from td_b_settlement_serial
    where id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
    delete from td_b_settlement_serial
    where id = #{id,jdbcType=BIGINT}
  </delete>
  <delete id="deleteByExample" parameterType="com.zteits.order.domain.TdBSettlementSerialExample">
    delete from td_b_settlement_serial
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="com.zteits.order.domain.TdBSettlementSerial">
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into td_b_settlement_serial (settlement_month, from_org_id, to_org_id, 
      settlement_total_fee, settlement_act_fee, settlement_state, 
      op_emp_id, op_emp_name, create_date, 
      data_state, remark)
    values (#{settlementMonth,jdbcType=VARCHAR}, #{fromOrgId,jdbcType=BIGINT}, #{toOrgId,jdbcType=BIGINT}, 
      #{settlementTotalFee,jdbcType=BIGINT}, #{settlementActFee,jdbcType=BIGINT}, #{settlementState,jdbcType=INTEGER}, 
      #{opEmpId,jdbcType=VARCHAR}, #{opEmpName,jdbcType=VARCHAR}, #{createDate,jdbcType=TIMESTAMP}, 
      #{dataState,jdbcType=INTEGER}, #{remark,jdbcType=VARCHAR})
  </insert>
  <insert id="insertSelective" parameterType="com.zteits.order.domain.TdBSettlementSerial">
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into td_b_settlement_serial
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="settlementMonth != null">
        settlement_month,
      </if>
      <if test="fromOrgId != null">
        from_org_id,
      </if>
      <if test="toOrgId != null">
        to_org_id,
      </if>
      <if test="settlementTotalFee != null">
        settlement_total_fee,
      </if>
      <if test="settlementActFee != null">
        settlement_act_fee,
      </if>
      <if test="settlementState != null">
        settlement_state,
      </if>
      <if test="opEmpId != null">
        op_emp_id,
      </if>
      <if test="opEmpName != null">
        op_emp_name,
      </if>
      <if test="createDate != null">
        create_date,
      </if>
      <if test="dataState != null">
        data_state,
      </if>
      <if test="remark != null">
        remark,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="settlementMonth != null">
        #{settlementMonth,jdbcType=VARCHAR},
      </if>
      <if test="fromOrgId != null">
        #{fromOrgId,jdbcType=BIGINT},
      </if>
      <if test="toOrgId != null">
        #{toOrgId,jdbcType=BIGINT},
      </if>
      <if test="settlementTotalFee != null">
        #{settlementTotalFee,jdbcType=BIGINT},
      </if>
      <if test="settlementActFee != null">
        #{settlementActFee,jdbcType=BIGINT},
      </if>
      <if test="settlementState != null">
        #{settlementState,jdbcType=INTEGER},
      </if>
      <if test="opEmpId != null">
        #{opEmpId,jdbcType=VARCHAR},
      </if>
      <if test="opEmpName != null">
        #{opEmpName,jdbcType=VARCHAR},
      </if>
      <if test="createDate != null">
        #{createDate,jdbcType=TIMESTAMP},
      </if>
      <if test="dataState != null">
        #{dataState,jdbcType=INTEGER},
      </if>
      <if test="remark != null">
        #{remark,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="com.zteits.order.domain.TdBSettlementSerialExample" resultType="java.lang.Long">
    select count(*) from td_b_settlement_serial
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map">
    update td_b_settlement_serial
    <set>
      <if test="record.id != null">
        id = #{record.id,jdbcType=BIGINT},
      </if>
      <if test="record.settlementMonth != null">
        settlement_month = #{record.settlementMonth,jdbcType=VARCHAR},
      </if>
      <if test="record.fromOrgId != null">
        from_org_id = #{record.fromOrgId,jdbcType=BIGINT},
      </if>
      <if test="record.toOrgId != null">
        to_org_id = #{record.toOrgId,jdbcType=BIGINT},
      </if>
      <if test="record.settlementTotalFee != null">
        settlement_total_fee = #{record.settlementTotalFee,jdbcType=BIGINT},
      </if>
      <if test="record.settlementActFee != null">
        settlement_act_fee = #{record.settlementActFee,jdbcType=BIGINT},
      </if>
      <if test="record.settlementState != null">
        settlement_state = #{record.settlementState,jdbcType=INTEGER},
      </if>
      <if test="record.opEmpId != null">
        op_emp_id = #{record.opEmpId,jdbcType=VARCHAR},
      </if>
      <if test="record.opEmpName != null">
        op_emp_name = #{record.opEmpName,jdbcType=VARCHAR},
      </if>
      <if test="record.createDate != null">
        create_date = #{record.createDate,jdbcType=TIMESTAMP},
      </if>
      <if test="record.dataState != null">
        data_state = #{record.dataState,jdbcType=INTEGER},
      </if>
      <if test="record.remark != null">
        remark = #{record.remark,jdbcType=VARCHAR},
      </if>
    </set>
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExample" parameterType="map">
    update td_b_settlement_serial
    set id = #{record.id,jdbcType=BIGINT},
      settlement_month = #{record.settlementMonth,jdbcType=VARCHAR},
      from_org_id = #{record.fromOrgId,jdbcType=BIGINT},
      to_org_id = #{record.toOrgId,jdbcType=BIGINT},
      settlement_total_fee = #{record.settlementTotalFee,jdbcType=BIGINT},
      settlement_act_fee = #{record.settlementActFee,jdbcType=BIGINT},
      settlement_state = #{record.settlementState,jdbcType=INTEGER},
      op_emp_id = #{record.opEmpId,jdbcType=VARCHAR},
      op_emp_name = #{record.opEmpName,jdbcType=VARCHAR},
      create_date = #{record.createDate,jdbcType=TIMESTAMP},
      data_state = #{record.dataState,jdbcType=INTEGER},
      remark = #{record.remark,jdbcType=VARCHAR}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="com.zteits.order.domain.TdBSettlementSerial">
    update td_b_settlement_serial
    <set>
      <if test="settlementMonth != null">
        settlement_month = #{settlementMonth,jdbcType=VARCHAR},
      </if>
      <if test="fromOrgId != null">
        from_org_id = #{fromOrgId,jdbcType=BIGINT},
      </if>
      <if test="toOrgId != null">
        to_org_id = #{toOrgId,jdbcType=BIGINT},
      </if>
      <if test="settlementTotalFee != null">
        settlement_total_fee = #{settlementTotalFee,jdbcType=BIGINT},
      </if>
      <if test="settlementActFee != null">
        settlement_act_fee = #{settlementActFee,jdbcType=BIGINT},
      </if>
      <if test="settlementState != null">
        settlement_state = #{settlementState,jdbcType=INTEGER},
      </if>
      <if test="opEmpId != null">
        op_emp_id = #{opEmpId,jdbcType=VARCHAR},
      </if>
      <if test="opEmpName != null">
        op_emp_name = #{opEmpName,jdbcType=VARCHAR},
      </if>
      <if test="createDate != null">
        create_date = #{createDate,jdbcType=TIMESTAMP},
      </if>
      <if test="dataState != null">
        data_state = #{dataState,jdbcType=INTEGER},
      </if>
      <if test="remark != null">
        remark = #{remark,jdbcType=VARCHAR},
      </if>
    </set>
    where id = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.zteits.order.domain.TdBSettlementSerial">
    update td_b_settlement_serial
    set settlement_month = #{settlementMonth,jdbcType=VARCHAR},
      from_org_id = #{fromOrgId,jdbcType=BIGINT},
      to_org_id = #{toOrgId,jdbcType=BIGINT},
      settlement_total_fee = #{settlementTotalFee,jdbcType=BIGINT},
      settlement_act_fee = #{settlementActFee,jdbcType=BIGINT},
      settlement_state = #{settlementState,jdbcType=INTEGER},
      op_emp_id = #{opEmpId,jdbcType=VARCHAR},
      op_emp_name = #{opEmpName,jdbcType=VARCHAR},
      create_date = #{createDate,jdbcType=TIMESTAMP},
      data_state = #{dataState,jdbcType=INTEGER},
      remark = #{remark,jdbcType=VARCHAR}
    where id = #{id,jdbcType=BIGINT}
  </update>
</mapper>