<?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.CwBdRelationMapper"> <resultMap id="BaseResultMap" type="com.dhcc.finance.main.domain.CwBdRelation"> <result column="PK_RELATION" jdbcType="VARCHAR" property="pkRelation" /> <result column="PK_SRCBILLTYPE" jdbcType="VARCHAR" property="pkSrcbilltype" /> <result column="PK_SRCBILLPK" jdbcType="VARCHAR" property="pkSrcbillpk" /> <result column="PK_VOUCHER" jdbcType="VARCHAR" property="pkVoucher" /> <result column="USE_STATE" jdbcType="VARCHAR" property="useState" /> <result column="CREATE_USER" jdbcType="VARCHAR" property="createUser" /> <result column="CREATE_TIME" jdbcType="TIMESTAMP" property="createTime" /> <result column="UPDATE_USER" jdbcType="VARCHAR" property="updateUser" /> <result column="UPDATE_TIME" jdbcType="TIMESTAMP" property="updateTime" /> <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"> PK_RELATION, PK_SRCBILLTYPE, PK_SRCBILLPK, PK_VOUCHER, USE_STATE, CREATE_USER, CREATE_TIME, UPDATE_USER, UPDATE_TIME, REMARK </sql> <select id="selectByExample" parameterType="com.dhcc.finance.main.domain.CwBdRelationExample" resultMap="BaseResultMap"> select <if test="distinct"> distinct </if> <include refid="Base_Column_List" /> from cw_bd_relation <if test="_parameter != null"> <include refid="Example_Where_Clause" /> </if> <if test="orderByClause != null"> order by ${orderByClause} </if> </select> <delete id="deleteByExample" parameterType="com.dhcc.finance.main.domain.CwBdRelationExample"> delete from cw_bd_relation <if test="_parameter != null"> <include refid="Example_Where_Clause" /> </if> </delete> <insert id="insert" parameterType="com.dhcc.finance.main.domain.CwBdRelation"> insert into cw_bd_relation (PK_RELATION, PK_SRCBILLTYPE, PK_SRCBILLPK, PK_VOUCHER, USE_STATE, CREATE_USER, CREATE_TIME, UPDATE_USER, UPDATE_TIME, REMARK) values (#{pkRelation,jdbcType=VARCHAR}, #{pkSrcbilltype,jdbcType=VARCHAR}, #{pkSrcbillpk,jdbcType=VARCHAR}, #{pkVoucher,jdbcType=VARCHAR}, #{useState,jdbcType=VARCHAR}, #{createUser,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{updateUser,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, #{remark,jdbcType=VARCHAR}) </insert> <insert id="insertSelective" parameterType="com.dhcc.finance.main.domain.CwBdRelation"> insert into cw_bd_relation <trim prefix="(" suffix=")" suffixOverrides=","> <if test="pkRelation != null"> PK_RELATION, </if> <if test="pkSrcbilltype != null"> PK_SRCBILLTYPE, </if> <if test="pkSrcbillpk != null"> PK_SRCBILLPK, </if> <if test="pkVoucher != null"> PK_VOUCHER, </if> <if test="useState != null"> USE_STATE, </if> <if test="createUser != null"> CREATE_USER, </if> <if test="createTime != null"> CREATE_TIME, </if> <if test="updateUser != null"> UPDATE_USER, </if> <if test="updateTime != null"> UPDATE_TIME, </if> <if test="remark != null"> REMARK, </if> </trim> <trim prefix="values (" suffix=")" suffixOverrides=","> <if test="pkRelation != null"> #{pkRelation,jdbcType=VARCHAR}, </if> <if test="pkSrcbilltype != null"> #{pkSrcbilltype,jdbcType=VARCHAR}, </if> <if test="pkSrcbillpk != null"> #{pkSrcbillpk,jdbcType=VARCHAR}, </if> <if test="pkVoucher != null"> #{pkVoucher,jdbcType=VARCHAR}, </if> <if test="useState != null"> #{useState,jdbcType=VARCHAR}, </if> <if test="createUser != null"> #{createUser,jdbcType=VARCHAR}, </if> <if test="createTime != null"> #{createTime,jdbcType=TIMESTAMP}, </if> <if test="updateUser != null"> #{updateUser,jdbcType=VARCHAR}, </if> <if test="updateTime != null"> #{updateTime,jdbcType=TIMESTAMP}, </if> <if test="remark != null"> #{remark,jdbcType=VARCHAR}, </if> </trim> </insert> <select id="countByExample" parameterType="com.dhcc.finance.main.domain.CwBdRelationExample" resultType="java.lang.Long"> select count(*) from cw_bd_relation <if test="_parameter != null"> <include refid="Example_Where_Clause" /> </if> </select> <update id="updateByExampleSelective" parameterType="map"> update cw_bd_relation <set> <if test="record.pkRelation != null"> PK_RELATION = #{record.pkRelation,jdbcType=VARCHAR}, </if> <if test="record.pkSrcbilltype != null"> PK_SRCBILLTYPE = #{record.pkSrcbilltype,jdbcType=VARCHAR}, </if> <if test="record.pkSrcbillpk != null"> PK_SRCBILLPK = #{record.pkSrcbillpk,jdbcType=VARCHAR}, </if> <if test="record.pkVoucher != null"> PK_VOUCHER = #{record.pkVoucher,jdbcType=VARCHAR}, </if> <if test="record.useState != null"> USE_STATE = #{record.useState,jdbcType=VARCHAR}, </if> <if test="record.createUser != null"> CREATE_USER = #{record.createUser,jdbcType=VARCHAR}, </if> <if test="record.createTime != null"> CREATE_TIME = #{record.createTime,jdbcType=TIMESTAMP}, </if> <if test="record.updateUser != null"> UPDATE_USER = #{record.updateUser,jdbcType=VARCHAR}, </if> <if test="record.updateTime != null"> UPDATE_TIME = #{record.updateTime,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 cw_bd_relation set PK_RELATION = #{record.pkRelation,jdbcType=VARCHAR}, PK_SRCBILLTYPE = #{record.pkSrcbilltype,jdbcType=VARCHAR}, PK_SRCBILLPK = #{record.pkSrcbillpk,jdbcType=VARCHAR}, PK_VOUCHER = #{record.pkVoucher,jdbcType=VARCHAR}, USE_STATE = #{record.useState,jdbcType=VARCHAR}, CREATE_USER = #{record.createUser,jdbcType=VARCHAR}, CREATE_TIME = #{record.createTime,jdbcType=TIMESTAMP}, UPDATE_USER = #{record.updateUser,jdbcType=VARCHAR}, UPDATE_TIME = #{record.updateTime,jdbcType=TIMESTAMP}, REMARK = #{record.remark,jdbcType=VARCHAR} <if test="_parameter != null"> <include refid="Update_By_Example_Where_Clause" /> </if> </update> <!-- 逻辑删除凭证单据明细信息 --> <update id="updateCwBdRelationForSyzt" parameterType="java.lang.String"> update cw_bd_relation set USE_STATE='0' where PK_RELATION =#{pkRelation,jdbcType=VARCHAR} </update> </mapper>