AsDetailContractAssetsMapper.xml 11.2 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.dhcc.finance.main.dao.AsDetailContractAssetsMapper">
  <resultMap id="BaseResultMap" type="com.dhcc.finance.main.domain.AsDetailContractAssets">
    <id column="ID" jdbcType="VARCHAR" property="id" />
    <result column="TZZCBH" jdbcType="VARCHAR" property="tzzcbh" />
    <result column="WTHTBH" jdbcType="VARCHAR" property="wthtbh" />
    <result column="JJBH" jdbcType="VARCHAR" property="jjbh" />
    <result column="YYHTBH" jdbcType="VARCHAR" property="yyhtbh" />
    <result column="ZCRZJZ" jdbcType="DECIMAL" property="zcrzjz" />
    <result column="SFDZ" jdbcType="VARCHAR" property="sfdz" />
    <result column="DZRQ" jdbcType="DATE" property="dzrq" />
    <result column="XTXMBH" jdbcType="VARCHAR" property="xtxmbh" />
    <result column="XTZXMBH" jdbcType="VARCHAR" property="xtzxmbh" />
    <result column="CCLB" jdbcType="VARCHAR" property="cclb" />
  </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, TZZCBH, WTHTBH, JJBH, YYHTBH, ZCRZJZ, SFDZ, DZRQ, XTXMBH, XTZXMBH, CCLB
  </sql>
  <select id="selectByExample" parameterType="com.dhcc.finance.main.domain.AsDetailContractAssetsExample" resultMap="BaseResultMap">
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    from as_detail_contract_assets
    <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.String" resultMap="BaseResultMap">
    select 
    <include refid="Base_Column_List" />
    from as_detail_contract_assets
    where ID = #{id,jdbcType=VARCHAR}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
    delete from as_detail_contract_assets
    where ID = #{id,jdbcType=VARCHAR}
  </delete>
  <delete id="deleteByExample" parameterType="com.dhcc.finance.main.domain.AsDetailContractAssetsExample">
    delete from as_detail_contract_assets
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="com.dhcc.finance.main.domain.AsDetailContractAssets">
    insert into as_detail_contract_assets (ID, TZZCBH, WTHTBH, 
      JJBH, YYHTBH, ZCRZJZ, 
      SFDZ, DZRQ, XTXMBH, XTZXMBH, 
      CCLB)
    values (#{id,jdbcType=VARCHAR}, #{tzzcbh,jdbcType=VARCHAR}, #{wthtbh,jdbcType=VARCHAR}, 
      #{jjbh,jdbcType=VARCHAR}, #{yyhtbh,jdbcType=VARCHAR}, #{zcrzjz,jdbcType=DECIMAL}, 
      #{sfdz,jdbcType=VARCHAR}, #{dzrq,jdbcType=DATE}, #{xtxmbh,jdbcType=VARCHAR}, #{xtzxmbh,jdbcType=VARCHAR}, 
      #{cclb,jdbcType=VARCHAR})
  </insert>
  <insert id="insertSelective" parameterType="com.dhcc.finance.main.domain.AsDetailContractAssets">
    insert into as_detail_contract_assets
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        ID,
      </if>
      <if test="tzzcbh != null">
        TZZCBH,
      </if>
      <if test="wthtbh != null">
        WTHTBH,
      </if>
      <if test="jjbh != null">
        JJBH,
      </if>
      <if test="yyhtbh != null">
        YYHTBH,
      </if>
      <if test="zcrzjz != null">
        ZCRZJZ,
      </if>
      <if test="sfdz != null">
        SFDZ,
      </if>
      <if test="dzrq != null">
        DZRQ,
      </if>
      <if test="xtxmbh != null">
        XTXMBH,
      </if>
      <if test="xtzxmbh != null">
        XTZXMBH,
      </if>
      <if test="cclb != null">
        CCLB,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=VARCHAR},
      </if>
      <if test="tzzcbh != null">
        #{tzzcbh,jdbcType=VARCHAR},
      </if>
      <if test="wthtbh != null">
        #{wthtbh,jdbcType=VARCHAR},
      </if>
      <if test="jjbh != null">
        #{jjbh,jdbcType=VARCHAR},
      </if>
      <if test="yyhtbh != null">
        #{yyhtbh,jdbcType=VARCHAR},
      </if>
      <if test="zcrzjz != null">
        #{zcrzjz,jdbcType=DECIMAL},
      </if>
      <if test="sfdz != null">
        #{sfdz,jdbcType=VARCHAR},
      </if>
      <if test="dzrq != null">
        #{dzrq,jdbcType=DATE},
      </if>
      <if test="xtxmbh != null">
        #{xtxmbh,jdbcType=VARCHAR},
      </if>
      <if test="xtzxmbh != null">
        #{xtzxmbh,jdbcType=VARCHAR},
      </if>
      <if test="cclb != null">
        #{cclb,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="com.dhcc.finance.main.domain.AsDetailContractAssetsExample" resultType="java.lang.Long">
    select count(*) from as_detail_contract_assets
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map">
    update as_detail_contract_assets
    <set>
      <if test="record.id != null">
        ID = #{record.id,jdbcType=VARCHAR},
      </if>
      <if test="record.tzzcbh != null">
        TZZCBH = #{record.tzzcbh,jdbcType=VARCHAR},
      </if>
      <if test="record.wthtbh != null">
        WTHTBH = #{record.wthtbh,jdbcType=VARCHAR},
      </if>
      <if test="record.jjbh != null">
        JJBH = #{record.jjbh,jdbcType=VARCHAR},
      </if>
      <if test="record.yyhtbh != null">
        YYHTBH = #{record.yyhtbh,jdbcType=VARCHAR},
      </if>
      <if test="record.zcrzjz != null">
        ZCRZJZ = #{record.zcrzjz,jdbcType=DECIMAL},
      </if>
      <if test="record.sfdz != null">
        SFDZ = #{record.sfdz,jdbcType=VARCHAR},
      </if>
      <if test="record.dzrq != null">
        DZRQ = #{record.dzrq,jdbcType=DATE},
      </if>
      <if test="record.xtxmbh != null">
        XTXMBH = #{record.xtxmbh,jdbcType=VARCHAR},
      </if>
      <if test="record.xtzxmbh != null">
        XTZXMBH = #{record.xtzxmbh,jdbcType=VARCHAR},
      </if>
      <if test="record.cclb != null">
        CCLB = #{record.cclb,jdbcType=VARCHAR},
      </if>
    </set>
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExample" parameterType="map">
    update as_detail_contract_assets
    set ID = #{record.id,jdbcType=VARCHAR},
      TZZCBH = #{record.tzzcbh,jdbcType=VARCHAR},
      WTHTBH = #{record.wthtbh,jdbcType=VARCHAR},
      JJBH = #{record.jjbh,jdbcType=VARCHAR},
      YYHTBH = #{record.yyhtbh,jdbcType=VARCHAR},
      ZCRZJZ = #{record.zcrzjz,jdbcType=DECIMAL},
      SFDZ = #{record.sfdz,jdbcType=VARCHAR},
      DZRQ = #{record.dzrq,jdbcType=DATE},
      XTXMBH = #{record.xtxmbh,jdbcType=VARCHAR},
      XTZXMBH = #{record.xtzxmbh,jdbcType=VARCHAR},
      CCLB = #{record.cclb,jdbcType=VARCHAR}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="com.dhcc.finance.main.domain.AsDetailContractAssets">
    update as_detail_contract_assets
    <set>
      <if test="tzzcbh != null">
        TZZCBH = #{tzzcbh,jdbcType=VARCHAR},
      </if>
      <if test="wthtbh != null">
        WTHTBH = #{wthtbh,jdbcType=VARCHAR},
      </if>
      <if test="jjbh != null">
        JJBH = #{jjbh,jdbcType=VARCHAR},
      </if>
      <if test="yyhtbh != null">
        YYHTBH = #{yyhtbh,jdbcType=VARCHAR},
      </if>
      <if test="zcrzjz != null">
        ZCRZJZ = #{zcrzjz,jdbcType=DECIMAL},
      </if>
      <if test="sfdz != null">
        SFDZ = #{sfdz,jdbcType=VARCHAR},
      </if>
      <if test="dzrq != null">
        DZRQ = #{dzrq,jdbcType=DATE},
      </if>
      <if test="xtxmbh != null">
        XTXMBH = #{xtxmbh,jdbcType=VARCHAR},
      </if>
      <if test="xtzxmbh != null">
        XTZXMBH = #{xtzxmbh,jdbcType=VARCHAR},
      </if>
      <if test="cclb != null">
        CCLB = #{cclb,jdbcType=VARCHAR},
      </if>
    </set>
    where ID = #{id,jdbcType=VARCHAR}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.dhcc.finance.main.domain.AsDetailContractAssets">
    update as_detail_contract_assets
    set TZZCBH = #{tzzcbh,jdbcType=VARCHAR},
      WTHTBH = #{wthtbh,jdbcType=VARCHAR},
      JJBH = #{jjbh,jdbcType=VARCHAR},
      YYHTBH = #{yyhtbh,jdbcType=VARCHAR},
      ZCRZJZ = #{zcrzjz,jdbcType=DECIMAL},
      SFDZ = #{sfdz,jdbcType=VARCHAR},
      DZRQ = #{dzrq,jdbcType=DATE},
      XTXMBH = #{xtxmbh,jdbcType=VARCHAR},
      XTZXMBH = #{xtzxmbh,jdbcType=VARCHAR},
      CCLB = #{cclb,jdbcType=VARCHAR}
    where ID = #{id,jdbcType=VARCHAR}
  </update>
 <!--  资产入账(自动记账)中查询合同信息 -->
  <select id="searchDetailListByPCH" parameterType="java.lang.String" resultMap="BaseResultMap">
    SELECT  <include refid="Base_Column_List" /> FROM as_detail_contract_assets a
    WHERE EXISTS(SELECT 1 FROM busi_benlist_info b WHERE a.`WTHTBH`=b.`NBHTBH`
                AND b.`PCH`=#{pch,jdbcType=VARCHAR} AND b.`SYZT`='1' AND b.`CBMBZ`='1');
  </select>
</mapper>