| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589 |
- <?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.ydtech.modules.fnc.dao.FncVoucherMapper">
- <resultMap id="BaseResultMap" type="com.ydtech.modules.fnc.model.FncVoucher">
- <id column="c_seq_no" jdbcType="VARCHAR" property="cSeqNo"/>
- <id column="c_item_no" jdbcType="VARCHAR" property="cItemNo"/>
- <result column="c_vou_type" jdbcType="VARCHAR" property="cVouType"/>
- <result column="c_vou_kind" jdbcType="VARCHAR" property="cVouKind"/>
- <result column="c_red_flag" jdbcType="VARCHAR" property="cRedFlag"/>
- <result column="c_cav_flag" jdbcType="VARCHAR" property="cCavFlag"/>
- <result column="c_sbjt_no" jdbcType="VARCHAR" property="cSbjtNo"/>
- <result column="c_sbjt_memo" jdbcType="VARCHAR" property="cSbjtMemo"/>
- <result column="c_vou_memo" jdbcType="VARCHAR" property="cVouMemo"/>
- <result column="n_amt" jdbcType="DOUBLE" property="nAmt"/>
- <result column="n_exch_amt" jdbcType="DOUBLE" property="nExchAmt"/>
- <result column="c_cur_no" jdbcType="VARCHAR" property="cCurNo"/>
- <result column="n_rate" jdbcType="DOUBLE" property="nRate"/>
- <result column="c_chr_cur_no" jdbcType="VARCHAR" property="cChrCurNo"/>
- <result column="c_dptacc_no" jdbcType="VARCHAR" property="cDptaccNo"/>
- <result column="c_year_no" jdbcType="VARCHAR" property="cYearNo"/>
- <result column="t_vou_tm" jdbcType="DATE" property="tVouTm"/>
- <result column="c_dept_name" jdbcType="VARCHAR" property="cDeptName"/>
- <result column="c_status" jdbcType="VARCHAR" property="cStatus"/>
- <result column="c_crt_user" jdbcType="VARCHAR" property="cCrtUser"/>
- <result column="t_crt_tm" jdbcType="DATE" property="tCrtTm"/>
- </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">
- c_seq_no, c_item_no, c_vou_type, c_vou_kind, c_red_flag, c_cav_flag, c_sbjt_no, c_sbjt_memo,
- c_vou_memo, n_amt, n_exch_amt, c_cur_no, n_rate, c_chr_cur_no, c_dptacc_no, c_year_no,
- t_vou_tm, c_dept_name, c_status, c_crt_user, t_crt_tm
- </sql>
- <select id="selectByExample" parameterType="com.ydtech.modules.fnc.model.FncVoucherExample"
- resultMap="BaseResultMap">
- select
- <if test="distinct">
- distinct
- </if>
- 'true' as QUERYID,
- <include refid="Base_Column_List"/>
- from fnc_voucher
- <if test="_parameter != null">
- <include refid="Example_Where_Clause"/>
- </if>
- <if test="orderByClause != null">
- order by ${orderByClause}
- </if>
- </select>
- <select id="selectByPrimaryKey" parameterType="com.ydtech.modules.fnc.model.FncVoucherKey"
- resultMap="BaseResultMap">
- select
- <include refid="Base_Column_List"/>
- from fnc_voucher
- where c_seq_no = #{cSeqNo,jdbcType=VARCHAR}
- and c_item_no = #{cItemNo,jdbcType=VARCHAR}
- </select>
- <delete id="deleteByPrimaryKey" parameterType="com.ydtech.modules.fnc.model.FncVoucherKey">
- delete
- from fnc_voucher
- where c_seq_no = #{cSeqNo,jdbcType=VARCHAR}
- and c_item_no = #{cItemNo,jdbcType=VARCHAR}
- </delete>
- <delete id="deleteByExample" parameterType="com.ydtech.modules.fnc.model.FncVoucherExample">
- delete from fnc_voucher
- <if test="_parameter != null">
- <include refid="Example_Where_Clause"/>
- </if>
- </delete>
- <insert id="insert" parameterType="com.ydtech.modules.fnc.model.FncVoucher">
- insert into fnc_voucher (c_seq_no, c_item_no, c_vou_type,
- c_vou_kind, c_red_flag, c_cav_flag,
- c_sbjt_no, c_sbjt_memo, c_vou_memo,
- n_amt, n_exch_amt, c_cur_no,
- n_rate, c_chr_cur_no, c_dptacc_no,
- c_year_no, t_vou_tm, c_dept_name,
- c_status, c_crt_user, t_crt_tm)
- values (#{cSeqNo,jdbcType=VARCHAR}, #{cItemNo,jdbcType=VARCHAR}, #{cVouType,jdbcType=VARCHAR},
- #{cVouKind,jdbcType=VARCHAR}, #{cRedFlag,jdbcType=VARCHAR}, #{cCavFlag,jdbcType=VARCHAR},
- #{cSbjtNo,jdbcType=VARCHAR}, #{cSbjtMemo,jdbcType=VARCHAR}, #{cVouMemo,jdbcType=VARCHAR},
- #{nAmt,jdbcType=DOUBLE}, #{nExchAmt,jdbcType=DOUBLE}, #{cCurNo,jdbcType=VARCHAR},
- #{nRate,jdbcType=DOUBLE}, #{cChrCurNo,jdbcType=VARCHAR}, #{cDptaccNo,jdbcType=VARCHAR},
- #{cYearNo,jdbcType=VARCHAR}, #{tVouTm,jdbcType=DATE}, #{cDeptName,jdbcType=VARCHAR},
- #{cStatus,jdbcType=VARCHAR}, #{cCrtUser,jdbcType=VARCHAR}, #{tCrtTm,jdbcType=DATE})
- </insert>
- <insert id="insertSelective" parameterType="com.ydtech.modules.fnc.model.FncVoucher">
- insert into fnc_voucher
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="cSeqNo != null">
- c_seq_no,
- </if>
- <if test="cItemNo != null">
- c_item_no,
- </if>
- <if test="cVouType != null">
- c_vou_type,
- </if>
- <if test="cVouKind != null">
- c_vou_kind,
- </if>
- <if test="cRedFlag != null">
- c_red_flag,
- </if>
- <if test="cCavFlag != null">
- c_cav_flag,
- </if>
- <if test="cSbjtNo != null">
- c_sbjt_no,
- </if>
- <if test="cSbjtMemo != null">
- c_sbjt_memo,
- </if>
- <if test="cVouMemo != null">
- c_vou_memo,
- </if>
- <if test="nAmt != null">
- n_amt,
- </if>
- <if test="nExchAmt != null">
- n_exch_amt,
- </if>
- <if test="cCurNo != null">
- c_cur_no,
- </if>
- <if test="nRate != null">
- n_rate,
- </if>
- <if test="cChrCurNo != null">
- c_chr_cur_no,
- </if>
- <if test="cDptaccNo != null">
- c_dptacc_no,
- </if>
- <if test="cYearNo != null">
- c_year_no,
- </if>
- <if test="tVouTm != null">
- t_vou_tm,
- </if>
- <if test="cDeptName != null">
- c_dept_name,
- </if>
- <if test="cStatus != null">
- c_status,
- </if>
- <if test="cCrtUser != null">
- c_crt_user,
- </if>
- <if test="tCrtTm != null">
- t_crt_tm,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="cSeqNo != null">
- #{cSeqNo,jdbcType=VARCHAR},
- </if>
- <if test="cItemNo != null">
- #{cItemNo,jdbcType=VARCHAR},
- </if>
- <if test="cVouType != null">
- #{cVouType,jdbcType=VARCHAR},
- </if>
- <if test="cVouKind != null">
- #{cVouKind,jdbcType=VARCHAR},
- </if>
- <if test="cRedFlag != null">
- #{cRedFlag,jdbcType=VARCHAR},
- </if>
- <if test="cCavFlag != null">
- #{cCavFlag,jdbcType=VARCHAR},
- </if>
- <if test="cSbjtNo != null">
- #{cSbjtNo,jdbcType=VARCHAR},
- </if>
- <if test="cSbjtMemo != null">
- #{cSbjtMemo,jdbcType=VARCHAR},
- </if>
- <if test="cVouMemo != null">
- #{cVouMemo,jdbcType=VARCHAR},
- </if>
- <if test="nAmt != null">
- #{nAmt,jdbcType=DOUBLE},
- </if>
- <if test="nExchAmt != null">
- #{nExchAmt,jdbcType=DOUBLE},
- </if>
- <if test="cCurNo != null">
- #{cCurNo,jdbcType=VARCHAR},
- </if>
- <if test="nRate != null">
- #{nRate,jdbcType=DOUBLE},
- </if>
- <if test="cChrCurNo != null">
- #{cChrCurNo,jdbcType=VARCHAR},
- </if>
- <if test="cDptaccNo != null">
- #{cDptaccNo,jdbcType=VARCHAR},
- </if>
- <if test="cYearNo != null">
- #{cYearNo,jdbcType=VARCHAR},
- </if>
- <if test="tVouTm != null">
- #{tVouTm,jdbcType=DATE},
- </if>
- <if test="cDeptName != null">
- #{cDeptName,jdbcType=VARCHAR},
- </if>
- <if test="cStatus != null">
- #{cStatus,jdbcType=VARCHAR},
- </if>
- <if test="cCrtUser != null">
- #{cCrtUser,jdbcType=VARCHAR},
- </if>
- <if test="tCrtTm != null">
- #{tCrtTm,jdbcType=DATE},
- </if>
- </trim>
- </insert>
- <select id="countByExample" parameterType="com.ydtech.modules.fnc.model.FncVoucherExample"
- resultType="java.lang.Long">
- select count(*) from fnc_voucher
- <if test="_parameter != null">
- <include refid="Example_Where_Clause"/>
- </if>
- </select>
- <update id="updateByExampleSelective" parameterType="map">
- update fnc_voucher
- <set>
- <if test="record.cSeqNo != null">
- c_seq_no = #{record.cSeqNo,jdbcType=VARCHAR},
- </if>
- <if test="record.cItemNo != null">
- c_item_no = #{record.cItemNo,jdbcType=VARCHAR},
- </if>
- <if test="record.cVouType != null">
- c_vou_type = #{record.cVouType,jdbcType=VARCHAR},
- </if>
- <if test="record.cVouKind != null">
- c_vou_kind = #{record.cVouKind,jdbcType=VARCHAR},
- </if>
- <if test="record.cRedFlag != null">
- c_red_flag = #{record.cRedFlag,jdbcType=VARCHAR},
- </if>
- <if test="record.cCavFlag != null">
- c_cav_flag = #{record.cCavFlag,jdbcType=VARCHAR},
- </if>
- <if test="record.cSbjtNo != null">
- c_sbjt_no = #{record.cSbjtNo,jdbcType=VARCHAR},
- </if>
- <if test="record.cSbjtMemo != null">
- c_sbjt_memo = #{record.cSbjtMemo,jdbcType=VARCHAR},
- </if>
- <if test="record.cVouMemo != null">
- c_vou_memo = #{record.cVouMemo,jdbcType=VARCHAR},
- </if>
- <if test="record.nAmt != null">
- n_amt = #{record.nAmt,jdbcType=DOUBLE},
- </if>
- <if test="record.nExchAmt != null">
- n_exch_amt = #{record.nExchAmt,jdbcType=DOUBLE},
- </if>
- <if test="record.cCurNo != null">
- c_cur_no = #{record.cCurNo,jdbcType=VARCHAR},
- </if>
- <if test="record.nRate != null">
- n_rate = #{record.nRate,jdbcType=DOUBLE},
- </if>
- <if test="record.cChrCurNo != null">
- c_chr_cur_no = #{record.cChrCurNo,jdbcType=VARCHAR},
- </if>
- <if test="record.cDptaccNo != null">
- c_dptacc_no = #{record.cDptaccNo,jdbcType=VARCHAR},
- </if>
- <if test="record.cYearNo != null">
- c_year_no = #{record.cYearNo,jdbcType=VARCHAR},
- </if>
- <if test="record.tVouTm != null">
- t_vou_tm = #{record.tVouTm,jdbcType=DATE},
- </if>
- <if test="record.cDeptName != null">
- c_dept_name = #{record.cDeptName,jdbcType=VARCHAR},
- </if>
- <if test="record.cStatus != null">
- c_status = #{record.cStatus,jdbcType=VARCHAR},
- </if>
- <if test="record.cCrtUser != null">
- c_crt_user = #{record.cCrtUser,jdbcType=VARCHAR},
- </if>
- <if test="record.tCrtTm != null">
- t_crt_tm = #{record.tCrtTm,jdbcType=DATE},
- </if>
- </set>
- <if test="_parameter != null">
- <include refid="Update_By_Example_Where_Clause"/>
- </if>
- </update>
- <update id="updateByExample" parameterType="map">
- update fnc_voucher
- set c_seq_no = #{record.cSeqNo,jdbcType=VARCHAR},
- c_item_no = #{record.cItemNo,jdbcType=VARCHAR},
- c_vou_type = #{record.cVouType,jdbcType=VARCHAR},
- c_vou_kind = #{record.cVouKind,jdbcType=VARCHAR},
- c_red_flag = #{record.cRedFlag,jdbcType=VARCHAR},
- c_cav_flag = #{record.cCavFlag,jdbcType=VARCHAR},
- c_sbjt_no = #{record.cSbjtNo,jdbcType=VARCHAR},
- c_sbjt_memo = #{record.cSbjtMemo,jdbcType=VARCHAR},
- c_vou_memo = #{record.cVouMemo,jdbcType=VARCHAR},
- n_amt = #{record.nAmt,jdbcType=DOUBLE},
- n_exch_amt = #{record.nExchAmt,jdbcType=DOUBLE},
- c_cur_no = #{record.cCurNo,jdbcType=VARCHAR},
- n_rate = #{record.nRate,jdbcType=DOUBLE},
- c_chr_cur_no = #{record.cChrCurNo,jdbcType=VARCHAR},
- c_dptacc_no = #{record.cDptaccNo,jdbcType=VARCHAR},
- c_year_no = #{record.cYearNo,jdbcType=VARCHAR},
- t_vou_tm = #{record.tVouTm,jdbcType=DATE},
- c_dept_name = #{record.cDeptName,jdbcType=VARCHAR},
- c_status = #{record.cStatus,jdbcType=VARCHAR},
- c_crt_user = #{record.cCrtUser,jdbcType=VARCHAR},
- t_crt_tm = #{record.tCrtTm,jdbcType=DATE}
- <if test="_parameter != null">
- <include refid="Update_By_Example_Where_Clause"/>
- </if>
- </update>
- <update id="updateByPrimaryKeySelective" parameterType="com.ydtech.modules.fnc.model.FncVoucher">
- update fnc_voucher
- <set>
- <if test="cVouType != null">
- c_vou_type = #{cVouType,jdbcType=VARCHAR},
- </if>
- <if test="cVouKind != null">
- c_vou_kind = #{cVouKind,jdbcType=VARCHAR},
- </if>
- <if test="cRedFlag != null">
- c_red_flag = #{cRedFlag,jdbcType=VARCHAR},
- </if>
- <if test="cCavFlag != null">
- c_cav_flag = #{cCavFlag,jdbcType=VARCHAR},
- </if>
- <if test="cSbjtNo != null">
- c_sbjt_no = #{cSbjtNo,jdbcType=VARCHAR},
- </if>
- <if test="cSbjtMemo != null">
- c_sbjt_memo = #{cSbjtMemo,jdbcType=VARCHAR},
- </if>
- <if test="cVouMemo != null">
- c_vou_memo = #{cVouMemo,jdbcType=VARCHAR},
- </if>
- <if test="nAmt != null">
- n_amt = #{nAmt,jdbcType=DOUBLE},
- </if>
- <if test="nExchAmt != null">
- n_exch_amt = #{nExchAmt,jdbcType=DOUBLE},
- </if>
- <if test="cCurNo != null">
- c_cur_no = #{cCurNo,jdbcType=VARCHAR},
- </if>
- <if test="nRate != null">
- n_rate = #{nRate,jdbcType=DOUBLE},
- </if>
- <if test="cChrCurNo != null">
- c_chr_cur_no = #{cChrCurNo,jdbcType=VARCHAR},
- </if>
- <if test="cDptaccNo != null">
- c_dptacc_no = #{cDptaccNo,jdbcType=VARCHAR},
- </if>
- <if test="cYearNo != null">
- c_year_no = #{cYearNo,jdbcType=VARCHAR},
- </if>
- <if test="tVouTm != null">
- t_vou_tm = #{tVouTm,jdbcType=DATE},
- </if>
- <if test="cDeptName != null">
- c_dept_name = #{cDeptName,jdbcType=VARCHAR},
- </if>
- <if test="cStatus != null">
- c_status = #{cStatus,jdbcType=VARCHAR},
- </if>
- <if test="cCrtUser != null">
- c_crt_user = #{cCrtUser,jdbcType=VARCHAR},
- </if>
- <if test="tCrtTm != null">
- t_crt_tm = #{tCrtTm,jdbcType=DATE},
- </if>
- </set>
- where c_seq_no = #{cSeqNo,jdbcType=VARCHAR}
- and c_item_no = #{cItemNo,jdbcType=VARCHAR}
- </update>
- <update id="updateByPrimaryKey" parameterType="com.ydtech.modules.fnc.model.FncVoucher">
- update fnc_voucher
- set c_vou_type = #{cVouType,jdbcType=VARCHAR},
- c_vou_kind = #{cVouKind,jdbcType=VARCHAR},
- c_red_flag = #{cRedFlag,jdbcType=VARCHAR},
- c_cav_flag = #{cCavFlag,jdbcType=VARCHAR},
- c_sbjt_no = #{cSbjtNo,jdbcType=VARCHAR},
- c_sbjt_memo = #{cSbjtMemo,jdbcType=VARCHAR},
- c_vou_memo = #{cVouMemo,jdbcType=VARCHAR},
- n_amt = #{nAmt,jdbcType=DOUBLE},
- n_exch_amt = #{nExchAmt,jdbcType=DOUBLE},
- c_cur_no = #{cCurNo,jdbcType=VARCHAR},
- n_rate = #{nRate,jdbcType=DOUBLE},
- c_chr_cur_no = #{cChrCurNo,jdbcType=VARCHAR},
- c_dptacc_no = #{cDptaccNo,jdbcType=VARCHAR},
- c_year_no = #{cYearNo,jdbcType=VARCHAR},
- t_vou_tm = #{tVouTm,jdbcType=DATE},
- c_dept_name = #{cDeptName,jdbcType=VARCHAR},
- c_status = #{cStatus,jdbcType=VARCHAR},
- c_crt_user = #{cCrtUser,jdbcType=VARCHAR},
- t_crt_tm = #{tCrtTm,jdbcType=DATE}
- where c_seq_no = #{cSeqNo,jdbcType=VARCHAR}
- and c_item_no = #{cItemNo,jdbcType=VARCHAR}
- </update>
- <select id="queryVoucherByCodition" parameterType="com.ydtech.modules.fnc.vo.FncVoucherReq"
- resultMap="BaseResultMap">
- select
- c_seq_no, c_item_no, c_vou_type, c_vou_kind, c_red_flag, c_cav_flag, c_sbjt_no, c_sbjt_memo,
- c_vou_memo, n_amt, n_exch_amt, c_cur_no, n_rate, c_chr_cur_no, c_dptacc_no, c_year_no,
- t_vou_tm, c_dept_name, case c_status
- when '1' then '审核通过'
- when '0' then '初始状态'
- else '其他' end c_status, case c_crt_user
- when 'sys' then '系统自动生成'
- else '其他' end c_crt_user, t_crt_tm
- from fnc_voucher
- <trim prefix="WHERE" prefixOverrides="AND">
- <if test="cdptaccNo != null and cdptaccNo != ''">
- AND c_dptacc_no = #{cdptaccNo,jdbcType=VARCHAR}
- </if>
- <if test="cdeptName != null and cdeptName != ''">
- AND c_dept_name = #{cdeptName,jdbcType=VARCHAR}
- </if>
- <if test="cseqNo != null and cseqNo != ''">
- AND c_seq_no = #{cseqNo,jdbcType=VARCHAR}
- </if>
- <if test="cyearNo != null and cyearNo != ''">
- AND c_year_no = #{cyearNo,jdbcType=VARCHAR}
- </if>
- <if test="tvouTmStart != null and tvouTmEnd != null">
- AND DATE_FORMAT(t_vou_tm, '%Y-%m-%d') between DATE_FORMAT(#{tvouTmStart,jdbcType=TIMESTAMP}, '%Y-%m-%d')
- and DATE_FORMAT(#{tvouTmEnd,jdbcType=TIMESTAMP}, '%Y-%m-%d')
- </if>
- <if test="csbjtNo != null and csbjtNo != ''">
- AND c_sbjt_no = #{csbjtNo,jdbcType=VARCHAR}
- </if>
- <if test="namtMin != null and namtMax != null ">
- AND n_amt between #{namtMin,jdbcType=DOUBLE} and #{namtMax,jdbcType=DOUBLE}
- </if>
- </trim>
- </select>
- <select id="exportVoucherByCodition" parameterType="com.ydtech.modules.fnc.vo.FncVoucherReq"
- resultType="com.ydtech.modules.fnc.vo.FncVoucherVo">
- select
- c_dptacc_no cDptaccNo,
- (SELECT b.book_name from fnc_book b where b.book_code=a.c_dptacc_no) cDptaccName,
- c_seq_no cSeqNo,
- c_item_no cItemNo,
- c_year_no cYearNo,
- t_vou_tm tVouTm,
- case c_status
- when '1' then '审核通过'
- when '0' then '初始状态'
- else '其他' end cStatus,
- c_sbjt_no cSbjtNo,
- c_sbjt_memo cSbjtMemo,
- c_cav_flag cCavFlag,
- n_amt nAmt,
- c_cur_no cCurNo
- from fnc_voucher a
- <trim prefix="WHERE" prefixOverrides="AND">
- <if test="cdptaccNo != null and cdptaccNo != ''">
- AND c_dptacc_no = #{cdptaccNo,jdbcType=VARCHAR}
- </if>
- <if test="cdeptName != null and cdeptName != ''">
- AND c_dept_name = #{cdeptName,jdbcType=VARCHAR}
- </if>
- <if test="cseqNo != null and cseqNo != ''">
- AND c_seq_no = #{cseqNo,jdbcType=VARCHAR}
- </if>
- <if test="cyearNo != null and cyearNo != ''">
- AND c_year_no = #{cyearNo,jdbcType=VARCHAR}
- </if>
- <if test="tvouTmStart != null and tvouTmEnd != null">
- AND DATE_FORMAT(t_vou_tm, '%Y-%m-%d') between DATE_FORMAT(#{tvouTmStart,jdbcType=TIMESTAMP}, '%Y-%m-%d')
- and DATE_FORMAT(#{tvouTmEnd,jdbcType=TIMESTAMP}, '%Y-%m-%d')
- </if>
- <if test="csbjtNo != null and csbjtNo != ''">
- AND c_sbjt_no = #{csbjtNo,jdbcType=VARCHAR}
- </if>
- <if test="namtMin != null and namtMax != null ">
- AND n_amt between #{namtMin,jdbcType=DOUBLE} and #{namtMax,jdbcType=DOUBLE}
- </if>
- </trim>
- order by t_vou_tm,c_seq_no,c_item_no
- </select>
- <select id="queryVoucher" parameterType="com.ydtech.modules.fnc.vo.FncVoucherReq" resultMap="BaseResultMap">
- select
- c_seq_no,c_dptacc_no,c_year_no,t_vou_tm,
- case c_status
- when '1' then '审核通过'
- when '0' then '初始状态'
- else '其他' end c_status,
- case c_crt_user
- when 'sys' then '系统自动生成'
- else '其他' end c_crt_user
- from fnc_voucher
- <trim prefix="WHERE" prefixOverrides="AND">
- <if test="cdptaccNo != null and cdptaccNo != ''">
- AND c_dptacc_no = #{cdptaccNo,jdbcType=VARCHAR}
- </if>
- <if test="cseqNo != null and cseqNo != ''">
- AND c_seq_no = #{cseqNo,jdbcType=VARCHAR}
- </if>
- <if test="cyearNo != null and cyearNo != ''">
- AND c_year_no = #{cyearNo,jdbcType=VARCHAR}
- </if>
- <if test="tvouTmStart != null and tvouTmEnd != null ">
- AND DATE_FORMAT(t_vou_tm, '%Y-%m-%d') between DATE_FORMAT(#{tvouTmStart,jdbcType=TIMESTAMP}, '%Y-%m-%d')
- and DATE_FORMAT(#{tvouTmEnd,jdbcType=TIMESTAMP}, '%Y-%m-%d')
- </if>
- <if test="cdeptName != null and cdeptName != ''">
- AND c_dept_name = #{cdeptName,jdbcType=VARCHAR}
- </if>
- </trim>
- group by c_seq_no,c_dptacc_no,c_year_no,t_vou_tm,c_status,c_crt_user
- </select>
- </mapper>
|