TdBSettlementOrgMapper.xml 14.1 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.TdBSettlementOrgMapper">
  <resultMap id="BaseResultMap" type="com.zteits.order.domain.TdBSettlementOrg">
    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="from_org_id" jdbcType="BIGINT" property="fromOrgId" />
    <result column="from_org_name" jdbcType="VARCHAR" property="fromOrgName" />
    <result column="to_org_id" jdbcType="BIGINT" property="toOrgId" />
    <result column="to_org_name" jdbcType="VARCHAR" property="toOrgName" />
    <result column="settlement_type" jdbcType="INTEGER" property="settlementType" />
    <result column="rate" jdbcType="BIGINT" property="rate" />
    <result column="data_state" jdbcType="INTEGER" property="dataState" />
    <result column="create_emp_id" jdbcType="VARCHAR" property="createEmpId" />
    <result column="create_emp_name" jdbcType="VARCHAR" property="createEmpName" />
    <result column="create_date" jdbcType="TIMESTAMP" property="createDate" />
    <result column="modfiy_emp_id" jdbcType="VARCHAR" property="modfiyEmpId" />
    <result column="modfiy_emp_name" jdbcType="VARCHAR" property="modfiyEmpName" />
    <result column="modfiy_date" jdbcType="TIMESTAMP" property="modfiyDate" />
    <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, from_org_id, from_org_name, to_org_id, to_org_name, settlement_type, rate, data_state, 
    create_emp_id, create_emp_name, create_date, modfiy_emp_id, modfiy_emp_name, modfiy_date, 
    remark
  </sql>
  <select id="selectByExample" parameterType="com.zteits.order.domain.TdBSettlementOrgExample" resultMap="BaseResultMap">
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    from td_b_settlement_org
    <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_org
    where id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
    delete from td_b_settlement_org
    where id = #{id,jdbcType=BIGINT}
  </delete>
  <delete id="deleteByExample" parameterType="com.zteits.order.domain.TdBSettlementOrgExample">
    delete from td_b_settlement_org
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="com.zteits.order.domain.TdBSettlementOrg">
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into td_b_settlement_org (from_org_id, from_org_name, to_org_id, 
      to_org_name, settlement_type, rate, 
      data_state, create_emp_id, create_emp_name, 
      create_date, modfiy_emp_id, modfiy_emp_name, 
      modfiy_date, remark)
    values (#{fromOrgId,jdbcType=BIGINT}, #{fromOrgName,jdbcType=VARCHAR}, #{toOrgId,jdbcType=BIGINT}, 
      #{toOrgName,jdbcType=VARCHAR}, #{settlementType,jdbcType=INTEGER}, #{rate,jdbcType=BIGINT}, 
      #{dataState,jdbcType=INTEGER}, #{createEmpId,jdbcType=VARCHAR}, #{createEmpName,jdbcType=VARCHAR}, 
      #{createDate,jdbcType=TIMESTAMP}, #{modfiyEmpId,jdbcType=VARCHAR}, #{modfiyEmpName,jdbcType=VARCHAR}, 
      #{modfiyDate,jdbcType=TIMESTAMP}, #{remark,jdbcType=VARCHAR})
  </insert>
  <insert id="insertSelective" parameterType="com.zteits.order.domain.TdBSettlementOrg">
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into td_b_settlement_org
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="fromOrgId != null">
        from_org_id,
      </if>
      <if test="fromOrgName != null">
        from_org_name,
      </if>
      <if test="toOrgId != null">
        to_org_id,
      </if>
      <if test="toOrgName != null">
        to_org_name,
      </if>
      <if test="settlementType != null">
        settlement_type,
      </if>
      <if test="rate != null">
        rate,
      </if>
      <if test="dataState != null">
        data_state,
      </if>
      <if test="createEmpId != null">
        create_emp_id,
      </if>
      <if test="createEmpName != null">
        create_emp_name,
      </if>
      <if test="createDate != null">
        create_date,
      </if>
      <if test="modfiyEmpId != null">
        modfiy_emp_id,
      </if>
      <if test="modfiyEmpName != null">
        modfiy_emp_name,
      </if>
      <if test="modfiyDate != null">
        modfiy_date,
      </if>
      <if test="remark != null">
        remark,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="fromOrgId != null">
        #{fromOrgId,jdbcType=BIGINT},
      </if>
      <if test="fromOrgName != null">
        #{fromOrgName,jdbcType=VARCHAR},
      </if>
      <if test="toOrgId != null">
        #{toOrgId,jdbcType=BIGINT},
      </if>
      <if test="toOrgName != null">
        #{toOrgName,jdbcType=VARCHAR},
      </if>
      <if test="settlementType != null">
        #{settlementType,jdbcType=INTEGER},
      </if>
      <if test="rate != null">
        #{rate,jdbcType=BIGINT},
      </if>
      <if test="dataState != null">
        #{dataState,jdbcType=INTEGER},
      </if>
      <if test="createEmpId != null">
        #{createEmpId,jdbcType=VARCHAR},
      </if>
      <if test="createEmpName != null">
        #{createEmpName,jdbcType=VARCHAR},
      </if>
      <if test="createDate != null">
        #{createDate,jdbcType=TIMESTAMP},
      </if>
      <if test="modfiyEmpId != null">
        #{modfiyEmpId,jdbcType=VARCHAR},
      </if>
      <if test="modfiyEmpName != null">
        #{modfiyEmpName,jdbcType=VARCHAR},
      </if>
      <if test="modfiyDate != null">
        #{modfiyDate,jdbcType=TIMESTAMP},
      </if>
      <if test="remark != null">
        #{remark,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="com.zteits.order.domain.TdBSettlementOrgExample" resultType="java.lang.Long">
    select count(*) from td_b_settlement_org
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map">
    update td_b_settlement_org
    <set>
      <if test="record.id != null">
        id = #{record.id,jdbcType=BIGINT},
      </if>
      <if test="record.fromOrgId != null">
        from_org_id = #{record.fromOrgId,jdbcType=BIGINT},
      </if>
      <if test="record.fromOrgName != null">
        from_org_name = #{record.fromOrgName,jdbcType=VARCHAR},
      </if>
      <if test="record.toOrgId != null">
        to_org_id = #{record.toOrgId,jdbcType=BIGINT},
      </if>
      <if test="record.toOrgName != null">
        to_org_name = #{record.toOrgName,jdbcType=VARCHAR},
      </if>
      <if test="record.settlementType != null">
        settlement_type = #{record.settlementType,jdbcType=INTEGER},
      </if>
      <if test="record.rate != null">
        rate = #{record.rate,jdbcType=BIGINT},
      </if>
      <if test="record.dataState != null">
        data_state = #{record.dataState,jdbcType=INTEGER},
      </if>
      <if test="record.createEmpId != null">
        create_emp_id = #{record.createEmpId,jdbcType=VARCHAR},
      </if>
      <if test="record.createEmpName != null">
        create_emp_name = #{record.createEmpName,jdbcType=VARCHAR},
      </if>
      <if test="record.createDate != null">
        create_date = #{record.createDate,jdbcType=TIMESTAMP},
      </if>
      <if test="record.modfiyEmpId != null">
        modfiy_emp_id = #{record.modfiyEmpId,jdbcType=VARCHAR},
      </if>
      <if test="record.modfiyEmpName != null">
        modfiy_emp_name = #{record.modfiyEmpName,jdbcType=VARCHAR},
      </if>
      <if test="record.modfiyDate != null">
        modfiy_date = #{record.modfiyDate,jdbcType=TIMESTAMP},
      </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_org
    set id = #{record.id,jdbcType=BIGINT},
      from_org_id = #{record.fromOrgId,jdbcType=BIGINT},
      from_org_name = #{record.fromOrgName,jdbcType=VARCHAR},
      to_org_id = #{record.toOrgId,jdbcType=BIGINT},
      to_org_name = #{record.toOrgName,jdbcType=VARCHAR},
      settlement_type = #{record.settlementType,jdbcType=INTEGER},
      rate = #{record.rate,jdbcType=BIGINT},
      data_state = #{record.dataState,jdbcType=INTEGER},
      create_emp_id = #{record.createEmpId,jdbcType=VARCHAR},
      create_emp_name = #{record.createEmpName,jdbcType=VARCHAR},
      create_date = #{record.createDate,jdbcType=TIMESTAMP},
      modfiy_emp_id = #{record.modfiyEmpId,jdbcType=VARCHAR},
      modfiy_emp_name = #{record.modfiyEmpName,jdbcType=VARCHAR},
      modfiy_date = #{record.modfiyDate,jdbcType=TIMESTAMP},
      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.TdBSettlementOrg">
    update td_b_settlement_org
    <set>
      <if test="fromOrgId != null">
        from_org_id = #{fromOrgId,jdbcType=BIGINT},
      </if>
      <if test="fromOrgName != null">
        from_org_name = #{fromOrgName,jdbcType=VARCHAR},
      </if>
      <if test="toOrgId != null">
        to_org_id = #{toOrgId,jdbcType=BIGINT},
      </if>
      <if test="toOrgName != null">
        to_org_name = #{toOrgName,jdbcType=VARCHAR},
      </if>
      <if test="settlementType != null">
        settlement_type = #{settlementType,jdbcType=INTEGER},
      </if>
      <if test="rate != null">
        rate = #{rate,jdbcType=BIGINT},
      </if>
      <if test="dataState != null">
        data_state = #{dataState,jdbcType=INTEGER},
      </if>
      <if test="createEmpId != null">
        create_emp_id = #{createEmpId,jdbcType=VARCHAR},
      </if>
      <if test="createEmpName != null">
        create_emp_name = #{createEmpName,jdbcType=VARCHAR},
      </if>
      <if test="createDate != null">
        create_date = #{createDate,jdbcType=TIMESTAMP},
      </if>
      <if test="modfiyEmpId != null">
        modfiy_emp_id = #{modfiyEmpId,jdbcType=VARCHAR},
      </if>
      <if test="modfiyEmpName != null">
        modfiy_emp_name = #{modfiyEmpName,jdbcType=VARCHAR},
      </if>
      <if test="modfiyDate != null">
        modfiy_date = #{modfiyDate,jdbcType=TIMESTAMP},
      </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.TdBSettlementOrg">
    update td_b_settlement_org
    set from_org_id = #{fromOrgId,jdbcType=BIGINT},
      from_org_name = #{fromOrgName,jdbcType=VARCHAR},
      to_org_id = #{toOrgId,jdbcType=BIGINT},
      to_org_name = #{toOrgName,jdbcType=VARCHAR},
      settlement_type = #{settlementType,jdbcType=INTEGER},
      rate = #{rate,jdbcType=BIGINT},
      data_state = #{dataState,jdbcType=INTEGER},
      create_emp_id = #{createEmpId,jdbcType=VARCHAR},
      create_emp_name = #{createEmpName,jdbcType=VARCHAR},
      create_date = #{createDate,jdbcType=TIMESTAMP},
      modfiy_emp_id = #{modfiyEmpId,jdbcType=VARCHAR},
      modfiy_emp_name = #{modfiyEmpName,jdbcType=VARCHAR},
      modfiy_date = #{modfiyDate,jdbcType=TIMESTAMP},
      remark = #{remark,jdbcType=VARCHAR}
    where id = #{id,jdbcType=BIGINT}
  </update>
</mapper>