<?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.CwGlTransferdetailMapper"> <resultMap id="BaseResultMap" type="com.dhcc.finance.main.domain.CwGlTransferdetail"> <id column="PK_TRANSFERDETAIL" jdbcType="VARCHAR" property="pkTransferdetail" /> <result column="PK_TRANSFER" jdbcType="VARCHAR" property="pkTransfer" /> <result column="TRANSFERTYPE" jdbcType="VARCHAR" property="transfertype" /> <result column="PK_VOUCHERTYPE" jdbcType="VARCHAR" property="pkVouchertype" /> <result column="TRANSFREQUENCY" jdbcType="VARCHAR" property="transfrequency" /> <result column="DETAILORDER" jdbcType="VARCHAR" property="detailorder" /> <result column="NOTE" jdbcType="VARCHAR" property="note" /> <result column="ORIENTATION" jdbcType="VARCHAR" property="orientation" /> <result column="TRANSSYSTEM" jdbcType="VARCHAR" property="transsystem" /> <result column="PK_SRCACCSUBJ" jdbcType="VARCHAR" property="pkSrcaccsubj" /> <result column="SRCASS" jdbcType="VARCHAR" property="srcass" /> <result column="PK_DESACCSUBJ" jdbcType="VARCHAR" property="pkDesaccsubj" /> <result column="DESASS" jdbcType="VARCHAR" property="desass" /> <result column="PK_CURRTYPE" jdbcType="VARCHAR" property="pkCurrtype" /> <result column="ENABLESTATE" jdbcType="VARCHAR" property="enablestate" /> <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> <resultMap id="BaseResultMap1" type="com.dhcc.finance.main.model.CwGlTransferdetailAndSubName"> <id column="PK_TRANSFERDETAIL" jdbcType="VARCHAR" property="pkTransferdetail" /> <result column="PK_TRANSFER" jdbcType="VARCHAR" property="pkTransfer" /> <result column="TRANSFERTYPE" jdbcType="VARCHAR" property="transfertype" /> <result column="PK_VOUCHERTYPE" jdbcType="VARCHAR" property="pkVouchertype" /> <result column="TRANSFREQUENCY" jdbcType="VARCHAR" property="transfrequency" /> <result column="DETAILORDER" jdbcType="VARCHAR" property="detailorder" /> <result column="NOTE" jdbcType="VARCHAR" property="note" /> <result column="ORIENTATION" jdbcType="VARCHAR" property="orientation" /> <result column="TRANSSYSTEM" jdbcType="VARCHAR" property="transsystem" /> <result column="PK_SRCACCSUBJ" jdbcType="VARCHAR" property="pkSrcaccsubj" /> <result column="PK_SRCACCSUBJName" jdbcType="VARCHAR" property="pkSrcaccsubjName" /> <result column="SRCASS" jdbcType="VARCHAR" property="srcass" /> <result column="PK_DESACCSUBJ" jdbcType="VARCHAR" property="pkDesaccsubj" /> <result column="PK_DESACCSUBJName" jdbcType="VARCHAR" property="pkDesaccsubjName" /> <result column="DESASS" jdbcType="VARCHAR" property="desass" /> <result column="PK_CURRTYPE" jdbcType="VARCHAR" property="pkCurrtype" /> <result column="ENABLESTATE" jdbcType="VARCHAR" property="enablestate" /> <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_TRANSFERDETAIL, PK_TRANSFER, TRANSFERTYPE, PK_VOUCHERTYPE, TRANSFREQUENCY, DETAILORDER, NOTE, ORIENTATION, TRANSSYSTEM, PK_SRCACCSUBJ, SRCASS, PK_DESACCSUBJ, DESASS, PK_CURRTYPE, ENABLESTATE, USE_STATE, CREATE_USER, CREATE_TIME, UPDATE_USER, UPDATE_TIME, REMARK </sql> <select id="selectByExample" parameterType="com.dhcc.finance.main.domain.CwGlTransferdetailExample" resultMap="BaseResultMap"> select <if test="distinct"> distinct </if> <include refid="Base_Column_List" /> from cw_gl_transferdetail <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 cw_gl_transferdetail where PK_TRANSFERDETAIL = #{pkTransferdetail,jdbcType=VARCHAR} </select> <delete id="deleteByPrimaryKey" parameterType="java.lang.String"> delete from cw_gl_transferdetail where PK_TRANSFERDETAIL = #{pkTransferdetail,jdbcType=VARCHAR} </delete> <delete id="deleteByExample" parameterType="com.dhcc.finance.main.domain.CwGlTransferdetailExample"> delete from cw_gl_transferdetail <if test="_parameter != null"> <include refid="Example_Where_Clause" /> </if> </delete> <insert id="insert" parameterType="com.dhcc.finance.main.domain.CwGlTransferdetail"> insert into cw_gl_transferdetail (PK_TRANSFERDETAIL, PK_TRANSFER, TRANSFERTYPE, PK_VOUCHERTYPE, TRANSFREQUENCY, DETAILORDER, NOTE, ORIENTATION, TRANSSYSTEM, PK_SRCACCSUBJ, SRCASS, PK_DESACCSUBJ, DESASS, PK_CURRTYPE, ENABLESTATE, USE_STATE, CREATE_USER, CREATE_TIME, UPDATE_USER, UPDATE_TIME, REMARK ) values (#{pkTransferdetail,jdbcType=VARCHAR}, #{pkTransfer,jdbcType=VARCHAR}, #{transfertype,jdbcType=VARCHAR}, #{pkVouchertype,jdbcType=VARCHAR}, #{transfrequency,jdbcType=VARCHAR}, #{detailorder,jdbcType=VARCHAR}, #{note,jdbcType=VARCHAR}, #{orientation,jdbcType=VARCHAR}, #{transsystem,jdbcType=VARCHAR}, #{pkSrcaccsubj,jdbcType=VARCHAR}, #{srcass,jdbcType=VARCHAR}, #{pkDesaccsubj,jdbcType=VARCHAR}, #{desass,jdbcType=VARCHAR}, #{pkCurrtype,jdbcType=VARCHAR}, #{enablestate,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.CwGlTransferdetail"> insert into cw_gl_transferdetail <trim prefix="(" suffix=")" suffixOverrides=","> <if test="pkTransferdetail != null"> PK_TRANSFERDETAIL, </if> <if test="pkTransfer != null"> PK_TRANSFER, </if> <if test="transfertype != null"> TRANSFERTYPE, </if> <if test="pkVouchertype != null"> PK_VOUCHERTYPE, </if> <if test="transfrequency != null"> TRANSFREQUENCY, </if> <if test="detailorder != null"> DETAILORDER, </if> <if test="note != null"> NOTE, </if> <if test="orientation != null"> ORIENTATION, </if> <if test="transsystem != null"> TRANSSYSTEM, </if> <if test="pkSrcaccsubj != null"> PK_SRCACCSUBJ, </if> <if test="srcass != null"> SRCASS, </if> <if test="pkDesaccsubj != null"> PK_DESACCSUBJ, </if> <if test="desass != null"> DESASS, </if> <if test="pkCurrtype != null"> PK_CURRTYPE, </if> <if test="enablestate != null"> ENABLESTATE, </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="pkTransferdetail != null"> #{pkTransferdetail,jdbcType=VARCHAR}, </if> <if test="pkTransfer != null"> #{pkTransfer,jdbcType=VARCHAR}, </if> <if test="transfertype != null"> #{transfertype,jdbcType=VARCHAR}, </if> <if test="pkVouchertype != null"> #{pkVouchertype,jdbcType=VARCHAR}, </if> <if test="transfrequency != null"> #{transfrequency,jdbcType=VARCHAR}, </if> <if test="detailorder != null"> #{detailorder,jdbcType=VARCHAR}, </if> <if test="note != null"> #{note,jdbcType=VARCHAR}, </if> <if test="orientation != null"> #{orientation,jdbcType=VARCHAR}, </if> <if test="transsystem != null"> #{transsystem,jdbcType=VARCHAR}, </if> <if test="pkSrcaccsubj != null"> #{pkSrcaccsubj,jdbcType=VARCHAR}, </if> <if test="srcass != null"> #{srcass,jdbcType=VARCHAR}, </if> <if test="pkDesaccsubj != null"> #{pkDesaccsubj,jdbcType=VARCHAR}, </if> <if test="desass != null"> #{desass,jdbcType=VARCHAR}, </if> <if test="pkCurrtype != null"> #{pkCurrtype,jdbcType=VARCHAR}, </if> <if test="enablestate != null"> #{enablestate,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.CwGlTransferdetailExample" resultType="java.lang.Long"> select count(*) from cw_gl_transferdetail <if test="_parameter != null"> <include refid="Example_Where_Clause" /> </if> </select> <update id="updateByExampleSelective" parameterType="map"> update cw_gl_transferdetail <set> <if test="record.pkTransferdetail != null"> PK_TRANSFERDETAIL = #{record.pkTransferdetail,jdbcType=VARCHAR}, </if> <if test="record.pkTransfer != null"> PK_TRANSFER = #{record.pkTransfer,jdbcType=VARCHAR}, </if> <if test="record.transfertype != null"> TRANSFERTYPE = #{record.transfertype,jdbcType=VARCHAR}, </if> <if test="record.pkVouchertype != null"> PK_VOUCHERTYPE = #{record.pkVouchertype,jdbcType=VARCHAR}, </if> <if test="record.transfrequency != null"> TRANSFREQUENCY = #{record.transfrequency,jdbcType=VARCHAR}, </if> <if test="record.detailorder != null"> DETAILORDER = #{record.detailorder,jdbcType=VARCHAR}, </if> <if test="record.note != null"> NOTE = #{record.note,jdbcType=VARCHAR}, </if> <if test="record.orientation != null"> ORIENTATION = #{record.orientation,jdbcType=VARCHAR}, </if> <if test="record.transsystem != null"> TRANSSYSTEM = #{record.transsystem,jdbcType=VARCHAR}, </if> <if test="record.pkSrcaccsubj != null"> PK_SRCACCSUBJ = #{record.pkSrcaccsubj,jdbcType=VARCHAR}, </if> <if test="record.srcass != null"> SRCASS = #{record.srcass,jdbcType=VARCHAR}, </if> <if test="record.pkDesaccsubj != null"> PK_DESACCSUBJ = #{record.pkDesaccsubj,jdbcType=VARCHAR}, </if> <if test="record.desass != null"> DESASS = #{record.desass,jdbcType=VARCHAR}, </if> <if test="record.pkCurrtype != null"> PK_CURRTYPE = #{record.pkCurrtype,jdbcType=VARCHAR}, </if> <if test="record.enablestate != null"> ENABLESTATE = #{record.enablestate,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_gl_transferdetail set PK_TRANSFERDETAIL = #{record.pkTransferdetail,jdbcType=VARCHAR}, PK_TRANSFER = #{record.pkTransfer,jdbcType=VARCHAR}, TRANSFERTYPE = #{record.transfertype,jdbcType=VARCHAR}, PK_VOUCHERTYPE = #{record.pkVouchertype,jdbcType=VARCHAR}, TRANSFREQUENCY = #{record.transfrequency,jdbcType=VARCHAR}, DETAILORDER = #{record.detailorder,jdbcType=VARCHAR}, NOTE = #{record.note,jdbcType=VARCHAR}, ORIENTATION = #{record.orientation,jdbcType=VARCHAR}, TRANSSYSTEM = #{record.transsystem,jdbcType=VARCHAR}, PK_SRCACCSUBJ = #{record.pkSrcaccsubj,jdbcType=VARCHAR}, SRCASS = #{record.srcass,jdbcType=VARCHAR}, PK_DESACCSUBJ = #{record.pkDesaccsubj,jdbcType=VARCHAR}, DESASS = #{record.desass,jdbcType=VARCHAR}, PK_CURRTYPE = #{record.pkCurrtype,jdbcType=VARCHAR}, ENABLESTATE = #{record.enablestate,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="updateByPrimaryKeySelective" parameterType="com.dhcc.finance.main.domain.CwGlTransferdetail"> update cw_gl_transferdetail <set> <if test="pkTransfer != null"> PK_TRANSFER = #{pkTransfer,jdbcType=VARCHAR}, </if> <if test="transfertype != null"> TRANSFERTYPE = #{transfertype,jdbcType=VARCHAR}, </if> <if test="pkVouchertype != null"> PK_VOUCHERTYPE = #{pkVouchertype,jdbcType=VARCHAR}, </if> <if test="transfrequency != null"> TRANSFREQUENCY = #{transfrequency,jdbcType=VARCHAR}, </if> <if test="detailorder != null"> DETAILORDER = #{detailorder,jdbcType=VARCHAR}, </if> <if test="note != null"> NOTE = #{note,jdbcType=VARCHAR}, </if> <if test="orientation != null"> ORIENTATION = #{orientation,jdbcType=VARCHAR}, </if> <if test="transsystem != null"> TRANSSYSTEM = #{transsystem,jdbcType=VARCHAR}, </if> <if test="pkSrcaccsubj != null"> PK_SRCACCSUBJ = #{pkSrcaccsubj,jdbcType=VARCHAR}, </if> <if test="srcass != null"> SRCASS = #{srcass,jdbcType=VARCHAR}, </if> <if test="pkDesaccsubj != null"> PK_DESACCSUBJ = #{pkDesaccsubj,jdbcType=VARCHAR}, </if> <if test="desass != null"> DESASS = #{desass,jdbcType=VARCHAR}, </if> <if test="pkCurrtype != null"> PK_CURRTYPE = #{pkCurrtype,jdbcType=VARCHAR}, </if> <if test="enablestate != null"> ENABLESTATE = #{enablestate,jdbcType=VARCHAR}, </if> <if test="useState != null"> USE_STATE = #{useState,jdbcType=VARCHAR}, </if> <if test="createUser != null"> CREATE_USER = #{createUser,jdbcType=VARCHAR}, </if> <if test="createTime != null"> CREATE_TIME = #{createTime,jdbcType=TIMESTAMP}, </if> <if test="updateUser != null"> UPDATE_USER = #{updateUser,jdbcType=VARCHAR}, </if> <if test="updateTime != null"> UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP}, </if> <if test="remark != null"> REMARK = #{remark,jdbcType=VARCHAR}, </if> </set> where PK_TRANSFERDETAIL = #{pkTransferdetail,jdbcType=VARCHAR} </update> <update id="updateByPrimaryKey" parameterType="com.dhcc.finance.main.domain.CwGlTransferdetail"> update cw_gl_transferdetail set PK_TRANSFER = #{pkTransfer,jdbcType=VARCHAR}, TRANSFERTYPE = #{transfertype,jdbcType=VARCHAR}, PK_VOUCHERTYPE = #{pkVouchertype,jdbcType=VARCHAR}, TRANSFREQUENCY = #{transfrequency,jdbcType=VARCHAR}, DETAILORDER = #{detailorder,jdbcType=VARCHAR}, NOTE = #{note,jdbcType=VARCHAR}, ORIENTATION = #{orientation,jdbcType=VARCHAR}, TRANSSYSTEM = #{transsystem,jdbcType=VARCHAR}, PK_SRCACCSUBJ = #{pkSrcaccsubj,jdbcType=VARCHAR}, SRCASS = #{srcass,jdbcType=VARCHAR}, PK_DESACCSUBJ = #{pkDesaccsubj,jdbcType=VARCHAR}, DESASS = #{desass,jdbcType=VARCHAR}, PK_CURRTYPE = #{pkCurrtype,jdbcType=VARCHAR}, ENABLESTATE = #{enablestate,jdbcType=VARCHAR}, USE_STATE = #{useState,jdbcType=VARCHAR}, CREATE_USER = #{createUser,jdbcType=VARCHAR}, CREATE_TIME = #{createTime,jdbcType=TIMESTAMP}, UPDATE_USER = #{updateUser,jdbcType=VARCHAR}, UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP}, REMARK = #{remark,jdbcType=VARCHAR} where PK_TRANSFERDETAIL = #{pkTransferdetail,jdbcType=VARCHAR} </update> <select id="selectCwGlTransferdetail" resultMap="BaseResultMap1"> select PK_TRANSFERDETAIL, PK_TRANSFER, TRANSFERTYPE, PK_VOUCHERTYPE, TRANSFREQUENCY, DETAILORDER, NOTE, ORIENTATION, TRANSSYSTEM, PK_SRCACCSUBJ, PK_SRCACCSUBJName,SRCASS, PK_DESACCSUBJ, PK_DESACCSUBJName,DESASS, PK_CURRTYPE, ENABLESTATE, USE_STATE, CREATE_USER, CREATE_TIME, UPDATE_USER, UPDATE_TIME, REMARK from ( select PK_TRANSFERDETAIL, PK_TRANSFER, TRANSFERTYPE, PK_VOUCHERTYPE, TRANSFREQUENCY, DETAILORDER, NOTE, ORIENTATION, TRANSSYSTEM, PK_SRCACCSUBJ,(select SUBJNAME from cw_bd_accsubj b where b.PK_ACCSUBJ=a.PK_SRCACCSUBJ) as PK_SRCACCSUBJName, SRCASS, PK_DESACCSUBJ, (select SUBJNAME from cw_bd_accsubj b where b.PK_ACCSUBJ=a.PK_DESACCSUBJ) as PK_DESACCSUBJName, DESASS, PK_CURRTYPE, ENABLESTATE, USE_STATE, CREATE_USER, CREATE_TIME, UPDATE_USER, UPDATE_TIME, REMARK from cw_gl_transferdetail a )temp where temp.USE_STATE='1' <if test="pkTransfer !=null"> and temp.PK_TRANSFER =#{pkTransfer,jdbcType=VARCHAR} </if> </select> <!-- 查询结转方案下是否有明细 --> <select id="searchCountDetail" resultType="java.lang.Long"> select count(1) from cw_gl_transferdetail where PK_TRANSFER =#{pkTransfer,jdbcType=VARCHAR} and USE_STATE='1' </select> <!-- 批量更新(批量逻辑删除) --> <update id="updateUseStateForBatch" parameterType="java.util.List"> update cw_gl_transferdetail set USE_STATE = '0' where PK_TRANSFERDETAIL in <foreach collection="list" open="(" item="item" separator="," close=")"> #{item,jdbcType=VARCHAR} </foreach> </update> </mapper>