<?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.CwGlDetailMapper"> <resultMap id="BaseResultMap" type="com.dhcc.finance.main.domain.CwGlDetail"> <id column="PK_DETAIL" jdbcType="VARCHAR" property="pkDetail"/> <result column="PK_GLORGBOOK" jdbcType="VARCHAR" property="pkGlorgbook"/> <result column="PK_VOUCHER" jdbcType="VARCHAR" property="pkVoucher"/> <result column="PREPAREDATE" jdbcType="DATE" property="preparedate"/> <result column="DETAILINDEX" jdbcType="VARCHAR" property="detailindex"/> <result column="ABSTRACTS" jdbcType="VARCHAR" property="abstracts"/> <result column="PK_ACCSUBJ" jdbcType="VARCHAR" property="pkAccsubj"/> <result column="SUBJCODE" jdbcType="VARCHAR" property="subjcode"/> <result column="SUBJNAME" jdbcType="VARCHAR" property="subjname"/> <result column="PK_CURRTYPE" jdbcType="VARCHAR" property="pkCurrtype"/> <result column="DEBITAMOUNT" jdbcType="DECIMAL" property="debitamount"/> <result column="CREDITAMOUNT" jdbcType="DECIMAL" property="creditamount"/> <result column="LOCALDEBITAMOUNT" jdbcType="DECIMAL" property="localdebitamount"/> <result column="LOCALCREDITAMOUNT" jdbcType="DECIMAL" property="localcreditamount"/> <result column="ASSID" jdbcType="VARCHAR" property="assid"/> <result column="QTY" jdbcType="VARCHAR" property="qty"/> <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="BaseResultMap2" type="com.dhcc.finance.main.model.CwGlDetailWeb"> <id column="PK_DETAIL" jdbcType="VARCHAR" property="pkDetail"/> <result column="PK_GLORGBOOK" jdbcType="VARCHAR" property="pkGlorgbook"/> <result column="PK_VOUCHER" jdbcType="VARCHAR" property="pkVoucher"/> <result column="PREPAREDATE" jdbcType="DATE" property="preparedate"/> <result column="DETAILINDEX" jdbcType="VARCHAR" property="detailindex"/> <result column="ABSTRACTS" jdbcType="VARCHAR" property="abstracts"/> <result column="PK_ACCSUBJ" jdbcType="VARCHAR" property="pkAccsubj"/> <result column="SUBJCODE" jdbcType="VARCHAR" property="subjcode"/> <result column="SUBJNAME" jdbcType="VARCHAR" property="subjname"/> <result column="PK_CURRTYPE" jdbcType="VARCHAR" property="pkCurrtype"/> <result column="DEBITAMOUNT" jdbcType="DECIMAL" property="debitamount"/> <result column="CREDITAMOUNT" jdbcType="DECIMAL" property="creditamount"/> <result column="LOCALDEBITAMOUNT" jdbcType="DECIMAL" property="localdebitamount"/> <result column="LOCALCREDITAMOUNT" jdbcType="DECIMAL" property="localcreditamount"/> <result column="ASSID" jdbcType="VARCHAR" property="assid"/> <result column="QTY" jdbcType="VARCHAR" property="qty"/> <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"/> <collection property="cwGlFreevalueList" resultMap="com.dhcc.finance.main.dao.CwGlFreevalueMapper.BaseResultMap"/> </resultMap> <resultMap id="BaseResultMap3" type="com.dhcc.finance.main.model.CwGlDetailAndVoucher"> <id column="PK_DETAIL" jdbcType="VARCHAR" property="pkDetail"/> <result column="PK_GLORGBOOK" jdbcType="VARCHAR" property="pkGlorgbook"/> <result column="PK_VOUCHERTY" jdbcType="VARCHAR" property="pkVoucherty"/> <result column="PERIOD" jdbcType="VARCHAR" property="period"/> <result column="PK_VOUCHER" jdbcType="VARCHAR" property="pkVoucher"/> <result column="DETAILINDEX" jdbcType="VARCHAR" property="detailindex"/> <result column="ABSTRACTS" jdbcType="VARCHAR" property="abstracts"/> <result column="PK_ACCSUBJ" jdbcType="VARCHAR" property="pkAccsubj"/> <result column="SUBJCODE" jdbcType="VARCHAR" property="subjcode"/> <result column="SUBJNAME" jdbcType="VARCHAR" property="subjname"/> <result column="PK_CURRTYPE" jdbcType="VARCHAR" property="pkCurrtype"/> <result column="DEBITAMOUNT" jdbcType="DECIMAL" property="debitamount"/> <result column="CREDITAMOUNT" jdbcType="DECIMAL" property="creditamount"/> <result column="LOCALDEBITAMOUNT" jdbcType="DECIMAL" property="localdebitamount"/> <result column="LOCALCREDITAMOUNT" jdbcType="DECIMAL" property="localcreditamount"/> <result column="ASSID" jdbcType="VARCHAR" property="assid"/> <result column="QTY" jdbcType="VARCHAR" property="qty"/> <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="BaseResultMap4" type="com.dhcc.finance.main.model.CwGlVoucherAndDetailWeb"> <id column="PK_VOUCHER" jdbcType="VARCHAR" property="pkVoucher"/> <result column="PK_GLORGBOOK" jdbcType="VARCHAR" property="pkGlorgbook"/> <result column="FQMJBH" jdbcType="VARCHAR" property="fqmjbh"/> <result column="NAME" jdbcType="VARCHAR" property="name"/> <result column="PERIOD" jdbcType="VARCHAR" property="period"/> <result column="PREPAREDATE" jdbcType="DATE" property="preparedate"/> <result column="OCC_DATE" jdbcType="DATE" property="occDate"/> <result column="VOUCHERNO" jdbcType="VARCHAR" property="voucherno"/> <result column="PK_SYSTEM" jdbcType="VARCHAR" property="pkSystem"/> <result column="abstractsVou" jdbcType="VARCHAR" property="abstractsVoucher"/> <result column="PK_PREPARED" jdbcType="VARCHAR" property="pkPrepared"/> <result column="abstractsDel" jdbcType="VARCHAR" property="abstractsDetail"/> <result column="SUBJCODE" jdbcType="VARCHAR" property="subjcode"/> <result column="SUBJNAME" jdbcType="VARCHAR" property="subjname"/> <result column="PK_CURRTYPE" jdbcType="VARCHAR" property="pkCurrtype"/> <result column="DEBITAMOUNT" jdbcType="DECIMAL" property="debitamount"/> <result column="CREDITAMOUNT" jdbcType="DECIMAL" property="creditamount"/> <result column="UPDATE_USER" jdbcType="VARCHAR" property="updateUser"/> <result column="UPDATE_TIME" jdbcType="TIMESTAMP" property="updateTime"/> </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_DETAIL, PK_GLORGBOOK, PK_VOUCHER, PREPAREDATE, DETAILINDEX, ABSTRACTS, PK_ACCSUBJ, SUBJCODE, SUBJNAME, PK_CURRTYPE, DEBITAMOUNT, CREDITAMOUNT, LOCALDEBITAMOUNT, LOCALCREDITAMOUNT, ASSID, QTY, USE_STATE, CREATE_USER, CREATE_TIME, UPDATE_USER, UPDATE_TIME, REMARK </sql> <select id="selectByExample" parameterType="com.dhcc.finance.main.domain.CwGlDetailExample" resultMap="BaseResultMap"> select <if test="distinct"> distinct </if> <include refid="Base_Column_List"/> from cw_gl_detail <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_detail where PK_DETAIL = #{pkDetail,jdbcType=VARCHAR} </select> <delete id="deleteByPrimaryKey" parameterType="java.lang.String"> delete from cw_gl_detail where PK_DETAIL = #{pkDetail,jdbcType=VARCHAR} </delete> <delete id="deleteByExample" parameterType="com.dhcc.finance.main.domain.CwGlDetailExample"> delete from cw_gl_detail <if test="_parameter != null"> <include refid="Example_Where_Clause"/> </if> </delete> <insert id="insert" parameterType="com.dhcc.finance.main.domain.CwGlDetail"> insert into cw_gl_detail (PK_DETAIL, PK_GLORGBOOK, PK_VOUCHER, PREPAREDATE, DETAILINDEX, ABSTRACTS, PK_ACCSUBJ, SUBJCODE, SUBJNAME, PK_CURRTYPE, DEBITAMOUNT, CREDITAMOUNT, LOCALDEBITAMOUNT, LOCALCREDITAMOUNT, ASSID, QTY, USE_STATE, CREATE_USER, CREATE_TIME, UPDATE_USER, UPDATE_TIME, REMARK) values (#{pkDetail,jdbcType=VARCHAR}, #{pkGlorgbook,jdbcType=VARCHAR}, #{pkVoucher,jdbcType=VARCHAR}, #{preparedate,jdbcType=DATE}, #{detailindex,jdbcType=VARCHAR}, #{abstracts,jdbcType=VARCHAR}, #{pkAccsubj,jdbcType=VARCHAR}, #{subjcode,jdbcType=VARCHAR}, #{subjname,jdbcType=VARCHAR}, #{pkCurrtype,jdbcType=VARCHAR}, #{debitamount,jdbcType=DECIMAL}, #{creditamount,jdbcType=DECIMAL}, #{localdebitamount,jdbcType=DECIMAL}, #{localcreditamount,jdbcType=DECIMAL}, #{assid,jdbcType=VARCHAR}, #{qty,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.CwGlDetail"> insert into cw_gl_detail <trim prefix="(" suffix=")" suffixOverrides=","> <if test="pkDetail != null"> PK_DETAIL, </if> <if test="pkGlorgbook != null"> PK_GLORGBOOK, </if> <if test="pkVoucher != null"> PK_VOUCHER, </if> <if test="preparedate != null"> PREPAREDATE, </if> <if test="detailindex != null"> DETAILINDEX, </if> <if test="abstracts != null"> ABSTRACTS, </if> <if test="pkAccsubj != null"> PK_ACCSUBJ, </if> <if test="subjcode != null"> SUBJCODE, </if> <if test="subjname != null"> SUBJNAME, </if> <if test="pkCurrtype != null"> PK_CURRTYPE, </if> <if test="debitamount != null"> DEBITAMOUNT, </if> <if test="creditamount != null"> CREDITAMOUNT, </if> <if test="localdebitamount != null"> LOCALDEBITAMOUNT, </if> <if test="localcreditamount != null"> LOCALCREDITAMOUNT, </if> <if test="assid != null"> ASSID, </if> <if test="qty != null"> QTY, </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="pkDetail != null"> #{pkDetail,jdbcType=VARCHAR}, </if> <if test="pkGlorgbook != null"> #{pkGlorgbook,jdbcType=VARCHAR}, </if> <if test="pkVoucher != null"> #{pkVoucher,jdbcType=VARCHAR}, </if> <if test="preparedate != null"> #{preparedate,jdbcType=DATE}, </if> <if test="detailindex != null"> #{detailindex,jdbcType=VARCHAR}, </if> <if test="abstracts != null"> #{abstracts,jdbcType=VARCHAR}, </if> <if test="pkAccsubj != null"> #{pkAccsubj,jdbcType=VARCHAR}, </if> <if test="subjcode != null"> #{subjcode,jdbcType=VARCHAR}, </if> <if test="subjname != null"> #{subjname,jdbcType=VARCHAR}, </if> <if test="pkCurrtype != null"> #{pkCurrtype,jdbcType=VARCHAR}, </if> <if test="debitamount != null"> #{debitamount,jdbcType=DECIMAL}, </if> <if test="creditamount != null"> #{creditamount,jdbcType=DECIMAL}, </if> <if test="localdebitamount != null"> #{localdebitamount,jdbcType=DECIMAL}, </if> <if test="localcreditamount != null"> #{localcreditamount,jdbcType=DECIMAL}, </if> <if test="assid != null"> #{assid,jdbcType=VARCHAR}, </if> <if test="qty != null"> #{qty,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.CwGlDetailExample" resultType="java.lang.Long"> select count(*) from cw_gl_detail <if test="_parameter != null"> <include refid="Example_Where_Clause"/> </if> </select> <update id="updateByExampleSelective" parameterType="map"> update cw_gl_detail <set> <if test="record.pkDetail != null"> PK_DETAIL = #{record.pkDetail,jdbcType=VARCHAR}, </if> <if test="record.pkGlorgbook != null"> PK_GLORGBOOK = #{record.pkGlorgbook,jdbcType=VARCHAR}, </if> <if test="record.pkVoucher != null"> PK_VOUCHER = #{record.pkVoucher,jdbcType=VARCHAR}, </if> <if test="record.preparedate != null"> PREPAREDATE = #{record.preparedate,jdbcType=DATE}, </if> <if test="record.detailindex != null"> DETAILINDEX = #{record.detailindex,jdbcType=VARCHAR}, </if> <if test="record.abstracts != null"> ABSTRACTS = #{record.abstracts,jdbcType=VARCHAR}, </if> <if test="record.pkAccsubj != null"> PK_ACCSUBJ = #{record.pkAccsubj,jdbcType=VARCHAR}, </if> <if test="record.subjcode != null"> SUBJCODE = #{record.subjcode,jdbcType=VARCHAR}, </if> <if test="record.subjname != null"> SUBJNAME = #{record.subjname,jdbcType=VARCHAR}, </if> <if test="record.pkCurrtype != null"> PK_CURRTYPE = #{record.pkCurrtype,jdbcType=VARCHAR}, </if> <if test="record.debitamount != null"> DEBITAMOUNT = #{record.debitamount,jdbcType=DECIMAL}, </if> <if test="record.creditamount != null"> CREDITAMOUNT = #{record.creditamount,jdbcType=DECIMAL}, </if> <if test="record.localdebitamount != null"> LOCALDEBITAMOUNT = #{record.localdebitamount,jdbcType=DECIMAL}, </if> <if test="record.localcreditamount != null"> LOCALCREDITAMOUNT = #{record.localcreditamount,jdbcType=DECIMAL}, </if> <if test="record.assid != null"> ASSID = #{record.assid,jdbcType=VARCHAR}, </if> <if test="record.qty != null"> QTY = #{record.qty,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_detail set PK_DETAIL = #{record.pkDetail,jdbcType=VARCHAR}, PK_GLORGBOOK = #{record.pkGlorgbook,jdbcType=VARCHAR}, PK_VOUCHER = #{record.pkVoucher,jdbcType=VARCHAR}, PREPAREDATE = #{record.preparedate,jdbcType=DATE}, DETAILINDEX = #{record.detailindex,jdbcType=VARCHAR}, ABSTRACTS = #{record.abstracts,jdbcType=VARCHAR}, PK_ACCSUBJ = #{record.pkAccsubj,jdbcType=VARCHAR}, SUBJCODE = #{record.subjcode,jdbcType=VARCHAR}, SUBJNAME = #{record.subjname,jdbcType=VARCHAR}, PK_CURRTYPE = #{record.pkCurrtype,jdbcType=VARCHAR}, DEBITAMOUNT = #{record.debitamount,jdbcType=DECIMAL}, CREDITAMOUNT = #{record.creditamount,jdbcType=DECIMAL}, LOCALDEBITAMOUNT = #{record.localdebitamount,jdbcType=DECIMAL}, LOCALCREDITAMOUNT = #{record.localcreditamount,jdbcType=DECIMAL}, ASSID = #{record.assid,jdbcType=VARCHAR}, QTY = #{record.qty,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.CwGlDetail"> update cw_gl_detail <set> <if test="pkGlorgbook != null"> PK_GLORGBOOK = #{pkGlorgbook,jdbcType=VARCHAR}, </if> <if test="pkVoucher != null"> PK_VOUCHER = #{pkVoucher,jdbcType=VARCHAR}, </if> <if test="preparedate != null"> PREPAREDATE = #{preparedate,jdbcType=DATE}, </if> <if test="detailindex != null"> DETAILINDEX = #{detailindex,jdbcType=VARCHAR}, </if> <if test="abstracts != null"> ABSTRACTS = #{abstracts,jdbcType=VARCHAR}, </if> <if test="pkAccsubj != null"> PK_ACCSUBJ = #{pkAccsubj,jdbcType=VARCHAR}, </if> <if test="subjcode != null"> SUBJCODE = #{subjcode,jdbcType=VARCHAR}, </if> <if test="subjname != null"> SUBJNAME = #{subjname,jdbcType=VARCHAR}, </if> <if test="pkCurrtype != null"> PK_CURRTYPE = #{pkCurrtype,jdbcType=VARCHAR}, </if> <if test="debitamount != null"> DEBITAMOUNT = #{debitamount,jdbcType=DECIMAL}, </if> <if test="creditamount != null"> CREDITAMOUNT = #{creditamount,jdbcType=DECIMAL}, </if> <if test="localdebitamount != null"> LOCALDEBITAMOUNT = #{localdebitamount,jdbcType=DECIMAL}, </if> <if test="localcreditamount != null"> LOCALCREDITAMOUNT = #{localcreditamount,jdbcType=DECIMAL}, </if> <if test="assid != null"> ASSID = #{assid,jdbcType=VARCHAR}, </if> <if test="qty != null"> QTY = #{qty,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_DETAIL = #{pkDetail,jdbcType=VARCHAR} </update> <update id="updateByPrimaryKey" parameterType="com.dhcc.finance.main.domain.CwGlDetail"> update cw_gl_detail set PK_GLORGBOOK = #{pkGlorgbook,jdbcType=VARCHAR}, PK_VOUCHER = #{pkVoucher,jdbcType=VARCHAR}, PREPAREDATE = #{preparedate,jdbcType=DATE}, DETAILINDEX = #{detailindex,jdbcType=VARCHAR}, ABSTRACTS = #{abstracts,jdbcType=VARCHAR}, PK_ACCSUBJ = #{pkAccsubj,jdbcType=VARCHAR}, SUBJCODE = #{subjcode,jdbcType=VARCHAR}, SUBJNAME = #{subjname,jdbcType=VARCHAR}, PK_CURRTYPE = #{pkCurrtype,jdbcType=VARCHAR}, DEBITAMOUNT = #{debitamount,jdbcType=DECIMAL}, CREDITAMOUNT = #{creditamount,jdbcType=DECIMAL}, LOCALDEBITAMOUNT = #{localdebitamount,jdbcType=DECIMAL}, LOCALCREDITAMOUNT = #{localcreditamount,jdbcType=DECIMAL}, ASSID = #{assid,jdbcType=VARCHAR}, QTY = #{qty,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_DETAIL = #{pkDetail,jdbcType=VARCHAR} </update> <!--批量新增数据 --> <insert id="insertCwGlDetailBatch" parameterType="java.util.List"> insert into cw_gl_detail (PK_DETAIL, PK_GLORGBOOK,PK_VOUCHER,PREPAREDATE, DETAILINDEX, ABSTRACTS, PK_ACCSUBJ, SUBJCODE, SUBJNAME, PK_CURRTYPE, DEBITAMOUNT, CREDITAMOUNT, LOCALDEBITAMOUNT, LOCALCREDITAMOUNT, ASSID, QTY, USE_STATE, CREATE_USER, CREATE_TIME, UPDATE_USER, UPDATE_TIME, REMARK) values <foreach collection="list" item="item" index="index" separator=","> ( #{item.pkDetail,jdbcType=VARCHAR},#{item.pkGlorgbook,jdbcType=VARCHAR}, #{item.pkVoucher,jdbcType=VARCHAR}, #{item.preparedate,jdbcType=DATE},#{item.detailindex,jdbcType=VARCHAR}, #{item.abstracts,jdbcType=VARCHAR}, #{item.pkAccsubj,jdbcType=VARCHAR}, #{item.subjcode,jdbcType=VARCHAR}, #{item.subjname,jdbcType=VARCHAR}, #{item.pkCurrtype,jdbcType=VARCHAR}, #{item.debitamount,jdbcType=DECIMAL}, #{item.creditamount,jdbcType=DECIMAL}, #{item.localdebitamount,jdbcType=DECIMAL}, #{item.localcreditamount,jdbcType=DECIMAL}, #{item.assid,jdbcType=VARCHAR}, #{item.qty,jdbcType=VARCHAR}, #{item.useState,jdbcType=VARCHAR}, #{item.createUser,jdbcType=VARCHAR}, #{item.createTime,jdbcType=TIMESTAMP}, #{item.updateUser,jdbcType=VARCHAR}, #{item.updateTime,jdbcType=TIMESTAMP}, #{item.remark,jdbcType=VARCHAR} ) </foreach> </insert> <!--删某凭证下所有分录信息 --> <update id="updateByPkVoucher" parameterType="java.lang.String"> update cw_gl_detail set USE_STATE = '0', UPDATE_USER = #{updateUser,jdbcType=VARCHAR}, UPDATE_TIME = now() where USE_STATE = '1' and PK_VOUCHER = #{pkVoucher,jdbcType=VARCHAR} </update> <select id="selectCwGlDetailandCwGlVoucher" resultMap="BaseResultMap3"> select a.PK_DETAIL,b.PK_GLORGBOOK,b.period,b.vouchertype, a.PK_VOUCHER, a.DETAILINDEX, a.ABSTRACTS, a.PK_ACCSUBJ, a.SUBJCODE, a.SUBJNAME, a.PK_CURRTYPE, a.DEBITAMOUNT, a.CREDITAMOUNT, a.LOCALDEBITAMOUNT, a.LOCALCREDITAMOUNT, a.ASSID, a.QTY, a.USE_STATE, a.CREATE_USER, a.CREATE_TIME, a.UPDATE_USER, a.UPDATE_TIME, a.REMARK from cw_gl_detail a join cw_gl_voucher b on a.PK_VOUCHER=b.PK_VOUCHER where b.vouchertype='3' and a.USE_STATE='1' <if test="pkGlorgbook != null"> and b.PK_GLORGBOOK=#{pkGlorgbook,jdbcType=VARCHAR} </if> <if test="period != null"> and b.period=#{period,jdbcType=VARCHAR} </if> <if test="pkVoucher != null"> and a.PK_VOUCHER=#{pkVoucher,jdbcType=VARCHAR} </if> </select> <!--查询某凭证下所有分录信息 --> <select id="selectByPkVoucher" parameterType="java.lang.String" resultMap="BaseResultMap"> select <include refid="Base_Column_List"/> from cw_gl_detail where PK_VOUCHER = #{pkVoucher,jdbcType=VARCHAR} and USE_STATE=#{useState,jdbcType=VARCHAR} </select> <!--期初新增凭证分录信息 --> <insert id="insertForInitbuild" parameterType="java.util.Map"> insert into cw_gl_detail (PK_DETAIL, PK_VOUCHER, PK_ACCSUBJ, SUBJCODE, SUBJNAME, PK_CURRTYPE, DEBITAMOUNT, CREDITAMOUNT, LOCALDEBITAMOUNT, LOCALCREDITAMOUNT, ASSID, USE_STATE, CREATE_USER, CREATE_TIME) select MD5(uuid()) as PK_DETAIL, #{pkVoucher,jdbcType=VARCHAR} as PK_VOUCHER, a.PK_ACCSUBJ, a.SUBJCODE, a.SUBJNAME, a.PK_CURRTYPE, b.DEBITAMOUNT, b.CREDITAMOUNT, b.LOCALDEBITAMOUNT, b.LOCALCREDITAMOUNT, b.ASSID, '1' as USE_STATE, #{createUser,jdbcType=VARCHAR} as CREATE_USER, #{createTime,jdbcType=TIMESTAMP} as CREATE_TIME from CW_GL_INITBUILD a inner join CW_GL_INITBUILD_B b on a.PK_INITBUILD = b.PK_INITBUILD and b.USE_STATE = '1' where a.PK_GLORGBOOK = #{pkGlorgbook,jdbcType=VARCHAR} and a.USE_STATE = '1' </insert> <!--逻辑删某凭证下所有分录信息 --> <update id="deleteByPkVoucherLogic" parameterType="com.dhcc.finance.main.domain.CwGlDetail"> update cw_gl_detail set USE_STATE = #{useState,jdbcType=VARCHAR} , UPDATE_USER = #{updateUser,jdbcType=VARCHAR}, <if test="preparedate !=null"> PREPAREDATE = #{preparedate,jdbcType=DATE}, </if> UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP} where <![CDATA[ USE_STATE<> #{useState,jdbcType=VARCHAR} ]]> and PK_VOUCHER = #{pkVoucher,jdbcType=VARCHAR} </update> <!-- 查询assid --> <select id="selectAssidList" parameterType="java.util.List" resultType="java.lang.String"> select distinct ASSID from cw_gl_detail <where>ASSID is not null and PK_VOUCHER in <foreach collection="list" open="(" item="item" separator="," close=")"> #{item.pkVoucher,jdbcType=VARCHAR} </foreach> </where> </select> <!-- 删除分录凭证表数据 --> <update id="updateUserStateForTwo" parameterType="java.util.List"> update cw_gl_detail set USE_STATE = '2' where PK_VOUCHER in <foreach collection="list" item="item" index="index" open="(" close=")" separator=","> #{item.pkVoucher,jdbcType=TIMESTAMP} </foreach> and USE_STATE = '1' </update> <!-- 查询指定科目余额 --> <select id="subBalanceCount" flushCache="true" parameterType="java.util.Map" resultType="java.util.Map"> select ifnull(sum(detail.LOCALDEBITAMOUNT),0) jieSum ,ifnull(sum(detail.LOCALCREDITAMOUNT),0) daiSum from (select PK_VOUCHER from CW_GL_VOUCHER where PK_GLORGBOOK = #{pkGlorgbook,jdbcType=VARCHAR} and USE_STATE ='1' and PK_SYSTEM='04' ) voucher inner join (select PK_VOUCHER, LOCALDEBITAMOUNT, LOCALCREDITAMOUNT from CW_GL_DETAIL where USE_STATE= '1' and SUBJCODE in <foreach collection="list" item="item" index="index" open="(" close=")" separator=","> #{item,jdbcType=VARCHAR} </foreach> ) detail on detail.PK_VOUCHER=voucher.PK_VOUCHER </select> <!-- 查询科目借方总额、贷方总额 --> <select id="searchBalanceCount" flushCache="true" parameterType="java.util.Map" resultType="java.util.Map"> select ifnull(sum(detail.LOCALDEBITAMOUNT),0) jieSum ,ifnull(sum(detail.LOCALCREDITAMOUNT),0) daiSum from (select PK_VOUCHER from CW_GL_VOUCHER where PK_GLORGBOOK = #{pkGlorgbook,jdbcType=VARCHAR} and USE_STATE ='1' and PK_SYSTEM='04' ) voucher inner join (select PK_VOUCHER, LOCALDEBITAMOUNT, LOCALCREDITAMOUNT from CW_GL_DETAIL where USE_STATE= '1' and SUBJCODE in <foreach collection="list" item="item" index="index" open="(" close=")" separator=","> #{item,jdbcType=VARCHAR} </foreach> <![CDATA[ and PREPAREDATE >=#{preparedateMin,jdbcType=VARCHAR} and PREPAREDATE <= #{preparedateMax,jdbcType=VARCHAR} and USE_STATE= '1']]> ) detail on detail.PK_VOUCHER=voucher.PK_VOUCHER </select> <!-- 查询期间内最大、最小生成凭证日期 --> <select id="searchPrepareDate" flushCache="true" parameterType="java.util.Map" resultType="java.util.Map"> select min(PREPAREDATE) as preparedateMin ,max(PREPAREDATE) as preparedateMax from CW_GL_VOUCHER a join cw_bd_glorgbook b on a.PK_GLORGBOOK = b.PK_GLORGBOOK where b.XTZXMBH = #{xtzxmbh,jdbcType=VARCHAR} <![CDATA[ and a.PREPAREDATE >=#{preparedateMin,jdbcType=VARCHAR} and a.PREPAREDATE <= #{preparedateMax,jdbcType=VARCHAR} ]]> and a.TRADECODE = #{tradeCode,jdbcType=VARCHAR} and a.USE_STATE ='1' and a.PK_SYSTEM='04' </select> <!-- 查询资金流水信息结息开始日期、结束日期 and SFZSZZS = #{sfzszzs,jdbcType=VARCHAR} --> <select id="searchJxksr" flushCache="true" parameterType="java.util.Map" resultType="java.util.Map"> select JXKSR as preparedateMinFlow ,JXJSR as preparedateMaxFlow from AS_FINSFLOW_INFO where syzt ='1' and JYLSBH = #{jylsbh,jdbcType=VARCHAR} and JYM = #{jym,jdbcType=VARCHAR} </select> <select id="searchLastTransTime" flushCache="true" parameterType="java.util.Map" resultType="java.util.Map"> select LAST_TRANS_TIME as preparedateMinFlow ,END_TRANS_TIME as preparedateMaxFlow from pm_costflow_info where USE_STATE ='1' and SERIAL_NO = #{serialNo,jdbcType=VARCHAR} and TRADECODE = #{jym,jdbcType=VARCHAR} </select> <!-- 分录更新 --> <update id="updateDetailBatch" parameterType="java.util.List"> <foreach collection="list" item="item" index="index" open="" close="" separator=";"> update cw_gl_detail <set> <if test="item.pkGlorgbook != null"> PK_GLORGBOOK = #{item.pkGlorgbook,jdbcType=VARCHAR}, </if> <if test="item.pkVoucher != null"> PK_VOUCHER = #{item.pkVoucher,jdbcType=VARCHAR}, </if> <if test="item.preparedate != null"> PREPAREDATE = #{item.preparedate,jdbcType=DATE}, </if> <if test="item.detailindex != null"> DETAILINDEX = #{item.detailindex,jdbcType=VARCHAR}, </if> <if test="item.abstracts != null"> ABSTRACTS = #{item.abstracts,jdbcType=VARCHAR}, </if> <if test="item.pkAccsubj != null"> PK_ACCSUBJ = #{item.pkAccsubj,jdbcType=VARCHAR}, </if> <if test="item.subjcode != null"> SUBJCODE = #{item.subjcode,jdbcType=VARCHAR}, </if> <if test="item.subjname != null"> SUBJNAME = #{item.subjname,jdbcType=VARCHAR}, </if> <if test="item.pkCurrtype != null"> PK_CURRTYPE = #{item.pkCurrtype,jdbcType=VARCHAR}, </if> <if test="item.debitamount != null"> DEBITAMOUNT = #{item.debitamount,jdbcType=DECIMAL}, </if> <if test="item.creditamount != null"> CREDITAMOUNT = #{item.creditamount,jdbcType=DECIMAL}, </if> <if test="item.localdebitamount != null"> LOCALDEBITAMOUNT = #{item.localdebitamount,jdbcType=DECIMAL}, </if> <if test="item.localcreditamount != null"> LOCALCREDITAMOUNT = #{item.localcreditamount,jdbcType=DECIMAL}, </if> <if test="item.assid != null"> ASSID = #{item.assid,jdbcType=VARCHAR}, </if> <if test="item.qty != null"> QTY = #{item.qty,jdbcType=VARCHAR}, </if> <if test="item.useState != null"> USE_STATE = #{item.useState,jdbcType=VARCHAR}, </if> <if test="item.updateUser != null"> UPDATE_USER = #{item.updateUser,jdbcType=VARCHAR}, </if> <if test="item.updateTime != null"> UPDATE_TIME = #{item.updateTime,jdbcType=TIMESTAMP}, </if> <if test="item.remark != null"> REMARK = #{item.remark,jdbcType=VARCHAR}, </if> </set> where PK_DETAIL = #{item.pkDetail,jdbcType=VARCHAR} </foreach> </update> <!-- 查询恢复分录信息 --> <select id="searchCwGlVoucherAndDetailWeb" parameterType="com.dhcc.finance.main.model.CwGlDetailLike" resultMap="BaseResultMap4"> select cgv.PK_VOUCHER,cgv.PK_GLORGBOOK, cgv.FQMJBH,(select name from CW_BD_GLORGBOOK b where b.PK_GLORGBOOK=cgv.PK_GLORGBOOK) as NAME,cgv.PERIOD, cgv.PREPAREDATE,cgv.OCC_DATE, cgv.VOUCHERNO,cgv.PK_SYSTEM, cgv.ABSTRACTS as abstractsVou, (select USER_NAME from sys_user_info C where C.USER_ID = cgv.PK_PREPARED ) AS PK_PREPARED, cgd.ABSTRACTS as abstractsDel, cgd.SUBJCODE,cgd.SUBJNAME,cgd.PK_CURRTYPE, cgd.DEBITAMOUNT,cgd.CREDITAMOUNT, (select USER_NAME from sys_user_info C where C.USER_ID = cgd.UPDATE_USER ) AS UPDATE_USER, cgd.UPDATE_TIME from cw_gl_voucher cgv left join cw_gl_detail cgd on cgv.PK_VOUCHER=cgd.PK_VOUCHER where cgv.USE_STATE='1' and cgd.USE_STATE='0' <if test="pkGlorgbook !=null"> and cgv.PK_GLORGBOOK = #{pkGlorgbook,jdbcType=VARCHAR} </if> <if test="period !=null"> and cgv.PERIOD = #{period,jdbcType=VARCHAR} </if> <if test="fqmjbh !=null"> and cgv.FQMJBH = #{fqmjbh,jdbcType=VARCHAR} </if> <if test="pkPrepared !=null"> and cgv.PK_PREPARED = #{pkPrepared,jdbcType=VARCHAR} </if> <if test="updateUser !=null"> and cgd.UPDATE_USER = #{updateUser,jdbcType=VARCHAR} </if> <if test="pkSystem !=null"> and cgv.PK_SYSTEM = #{pkSystem,jdbcType=VARCHAR} </if> <if test="vouchernoMin !=null and vouchernoMax == null"> <![CDATA[ and cgv.VOUCHERNO >= #{vouchernoMin,jdbcType=VARCHAR} + 0 ]]> </if> <if test="vouchernoMin == null and vouchernoMax !=null"> <![CDATA[ and cgv.VOUCHERNO <= #{vouchernoMax,jdbcType=VARCHAR} + 0 ]]> </if> <if test="vouchernoMin !=null and vouchernoMax!=null"> and cgv.VOUCHERNO between #{vouchernoMin,jdbcType=VARCHAR} + 0 and #{vouchernoMax,jdbcType=VARCHAR} + 0 </if> <if test="preparedateMin !=null and preparedateMax == null"> <![CDATA[ and cgv.PREPAREDATE >= #{preparedateMin,jdbcType=VARCHAR} ]]> </if> <if test="preparedateMin == null and preparedateMax !=null"> <![CDATA[ and cgv.PREPAREDATE <= #{preparedateMax,jdbcType=VARCHAR} ]]> </if> <if test="preparedateMin !=null and preparedateMax !=null"> and cgv.PREPAREDATE between #{preparedateMin,jdbcType=VARCHAR} and #{preparedateMax,jdbcType=VARCHAR} </if> <if test="occDateMin !=null and occDateMax == null"> <![CDATA[ and cgv.OCC_DATE >= #{occDateMin,jdbcType=VARCHAR} ]]> </if> <if test="occDateMin == null and occDateMax !=null"> <![CDATA[ and cgv.OCC_DATE <= #{occDateMax,jdbcType=VARCHAR} ]]> </if> <if test="occDateMin !=null and occDateMax !=null"> and cgv.OCC_DATE between #{occDateMin,jdbcType=VARCHAR} and #{occDateMax,jdbcType=VARCHAR} </if> <if test="abstracts !=null"> and cgv.ABSTRACTS LIKE "%"#{abstracts,jdbcType=VARCHAR}"%" </if> order by cgd.UPDATE_TIME desc,cgv.PREPAREDATE desc </select> <!---- 、// insert into cw_gl_detail (PK_DETAIL, PK_GLORGBOOK, PK_VOUCHER, PREPAREDATE, DETAILINDEX, ABSTRACTS, PK_ACCSUBJ, SUBJCODE, SUBJNAME, PK_CURRTYPE, DEBITAMOUNT, CREDITAMOUNT, LOCALDEBITAMOUNT, LOCALCREDITAMOUNT, ASSID, QTY, USE_STATE, CREATE_USER, CREATE_TIME, UPDATE_USER, REMARK)--> <select id="searchCwGlDetailByBatchNo" resultMap="BaseResultMap"> select MD5(uuid()) PK_DETAIL, b.PK_GLORGBOOK,c.PK_VOUCHER,c.PREPAREDATE, #{cwGlVoucherTempRequest.index,jdbcType=VARCHAR} DETAILINDEX,#{cwBdVouchtempB.abstracts,jdbcType=VARCHAR} ABSTRACTS,#{cwBdVouchtempB.pkAccsubj,jdbcType=VARCHAR} PK_ACCSUBJ, d.SUBJCODE,d.SUBJNAME,#{cwBdVouchtempB.pkCurrtype,jdbcType=VARCHAR} PK_CURRTYPE <if test='cwBdVouchtempB.direction =="1"'> ,a.VOUCHER_AMOUNT DEBITAMOUNT,0 CREDITAMOUNT,a.VOUCHER_AMOUNT LOCALDEBITAMOUNT,0 LOCALCREDITAMOUNT </if> <if test='cwBdVouchtempB.direction =="2"'> ,0 DEBITAMOUNT ,a.VOUCHER_AMOUNT CREDITAMOUNT,0 LOCALDEBITAMOUNT,a.VOUCHER_AMOUNT LOCALCREDITAMOUNT </if> <if test="cwGlVoucherTempRequest.hasItem"> , MD5(uuid()) ASSID </if> <if test="!cwGlVoucherTempRequest.hasItem"> ,null ASSID </if> ,'1' USE_STATE,a.CREATE_USER,a.CREATE_TIME,concat(a.id,#{cwBdVouchtempB.pkVouchtempB,jdbcType=VARCHAR}) REMARK from cw_bd_manual_serial a left join cw_bd_glorgbook b on a.SUB_PROJECT_CODE = b.XTZXMBH left join cw_gl_voucher c on c.REMARK = a.ID left join cw_bd_accsubj d on d.PK_ACCSUBJ = #{cwBdVouchtempB.pkAccsubj,jdbcType=VARCHAR} where BATCH_NO = #{cwGlVoucherTempRequest.batchNo,jdbcType=VARCHAR} and a.USE_STATE ='1' and b.USE_STATE ='1' and a.VOUCHER_TYPE = #{cwGlVoucherTempRequest.voucherType,jdbcType=VARCHAR} </select> </mapper>