123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294 |
- <?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.unis.transaction.server.dao.GiveBackDao">
-
- <sql id="givebackColumns">
- tkbm,jybm,wthbm,apcc,tkje,tksj,czr,tkpz,tkzt,tkztmc,remark,wtbm
- </sql>
-
- <sql id="givebackJoins">
-
- </sql>
-
- <select id="selectList" resultType="com.unis.transaction.server.entity.givebackbail.GiveBackDO" parameterType="com.unis.transaction.common.vo.givebackbail.GiveBackVO">
- SELECT
- *
- FROM ty_jybzjtk <include refid="givebackJoins" />
- <where>
- <if test="htbm != null and htbm != ''">
- and htbm like '%' || #{htbm} || '%'
- </if>
- <if test="ccbm != null and ccbm != ''">
- and ccbm = #{ccbm}
- </if>
- <if test="tkfl != null and tkfl != ''">
- and tkfl = #{tkfl}
- </if>
- </where>
- </select>
-
- <!--
- <select id="selectPageList" resultType="com.unis.transaction.common.vo.givebackbail.GiveBackVO" parameterType="com.unis.transaction.common.vo.givebackbail.GiveBackVO">
- select
- jybm.jybm,
- jybm.apcc,
- jybm.sl,
- jybm.je,
- jybm.dwmc,
- jybm.lxdh,
- jybm.bmrq,
- jybm.hkje,
- jybm.hksj,
- jybm.ccbm,
- jybm.remark,
- jybm.bzj,
- jybm.bmrq,
- jybm.wtbm,
- jybm.lspzmc,
- tk.wthbm,
- tk.tkbm,
- tk.tkfl,
- tk.tkzt,
- tk.tkztmc,
- tk.tksj
- from
- ty_jybzjtk tk
- join ty_jybm jybm on jybm.jybm = tk.jybm and jybm.status = 1
- left join ty_jytkwth tkwth on tkwth.apcc=jybm.apcc and tkwth.status = 1
- <where>
- and (tk.status = 1 or tk.status is null)
- <if test="apcc != null and apcc != ''">
- and jybm.apcc like '%' || #{apcc} || '%'
- </if>
- <if test="dwmc != null and dwmc != ''">
- and jybm.dwmc like '%' || #{dwmc} || '%'
- </if>
- <if test="hksjQuerystart != null">
- and jybm.hksj >= #{hksjQuerystart}
- </if>
- <if test="htbm != null and htbm != ''">
- and tkwth.htbm like '%' || #{htbm} || '%'
- </if>
- <if test="hksjQueryEnd != null">
- and jybm.hksj <= #{hksjQueryEnd}
- </if>
- <if test="tkzt != null">
- and tk.tkzt=#{tkzt}
- </if>
- <if test="tkfl != null">
- and tk.tkfl=#{tkfl}
- </if>
- <if test="jylx != null">
- and tk.wtbm in (select wtbm from ty_jycrkwt where jylx=#{jylx})
- </if>
- <if test="tkztList">
- and tk.tkzt in
- <foreach collection="tkztList" item="item" open="(" close=")" separator=",">
- #{item}
- </foreach>
- </if>
-
- </where>
- order by tk.tkbm desc
- </select>
- -->
-
- <select id="selectPageList" resultType="com.unis.transaction.common.vo.givebackbail.GiveBackVO" parameterType="com.unis.transaction.common.vo.givebackbail.GiveBackVO">
- select
- *
- from
- ty_jybzjtk tk
- <where>
- <if test="htbm != null and htbm != ''">
- and tk.htbm like '%' || #{htbm} || '%'
- </if>
- <if test="htbh != null and htbh != ''">
- and tk.htbh like '%' || #{htbh} || '%'
- </if>
- <if test="sjlx != null and sjlx != ''">
- and tk.sjlx = #{sjlx}
- </if>
- <if test="tkzt != null">
- and tk.tkzt=#{tkzt}
- </if>
- <if test="tkfl != null">
- and tk.tkfl=#{tkfl}
- </if>
- <if test="jylx != null">
- and tk.jylx=#{jylx}
- </if>
- <if test="tkztList!= null">
- and tk.tkzt in
- <foreach collection="tkztList" item="item" open="(" close=")" separator=",">
- #{item}
- </foreach>
- </if>
-
- </where>
- --order by tk.apcc desc
- order by tk.create_date desc
- </select>
-
-
- <select id="selectDetail" resultType="com.unis.transaction.server.entity.givebackbail.GiveBackDO"
- parameterType="com.unis.transaction.common.vo.givebackbail.GiveBackVO">
- SELECT
- *
- FROM ty_jybzjtk <include refid="givebackJoins" />
- <where>
- <if test="jybm != null and jybm != ''">
- and jybm = #{jybm}
- </if>
- <if test="sjlx != null and sjlx != ''">
- and sjlx = #{sjlx}
- </if>
- <if test="htbm != null and htbm != ''">
- and htbm = #{htbm}
- </if>
- <if test="ccbm != null and ccbm != ''">
- and ccbm = #{ccbm}
- </if>
- <if test="dwmc != null and dwmc != ''">
- and dwmc = #{dwmc}
- </if>
- <if test="dwbm != null and dwbm != ''">
- and dwbm = #{dwbm}
- </if>
- </where>
- </select>
-
- <select id="selectUnionDetail" resultType="com.unis.transaction.common.vo.givebackbail.GiveBackVO" parameterType="com.unis.transaction.common.vo.givebackbail.GiveBackVO">
- select
- jybm.jybm,
- jybm.apcc,
- jybm.sl,
- jybm.je,
- jybm.dwmc,
- jybm.lxdh,
- jybm.bmrq,
- jybm.hkje,
- jybm.lspzmc,
- jybm.sxfl,
- tkwth.wthbm,
- tk.tkbm,
- tk.tkzt,
- tk.tkztmc,
- tk.tkje,
- tk.tksj,
- tk.cwczr,
- tk.tksm,
- tk.hksj,
- tk.czr,
- tk.tkpz,
- tk.remark
- from
- ty_jybzjtk tk
- right join ty_jybm jybm on jybm.jybm = tk.jybm and jybm.status = 1
- left join ty_jytkwth tkwth on tkwth.apcc=jybm.apcc and tkwth.status = 1 and tkwth.zt = '91000051'
- <where>
- <if test="tkbm != null and tkbm !=''">
- and tk.tkbm = #{tkbm}
- </if>
- <if test="jybm != null and jybm !=''">
- and jybm.jybm = #{jybm}
- </if>
- </where>
- </select>
- <select id="selectGiveBackList" resultType="com.unis.transaction.common.vo.givebackbail.GiveBackVO">
- SELECT
- *
- FROM ty_jybzjtk <include refid="givebackJoins" />
- where tkfl is null and sjlx = '0'
- </select>
- <select id="selectDetailByWthbm" resultType="com.unis.transaction.server.entity.givebackbail.GiveBackDO">
- SELECT
- *
- FROM ty_jybzjtk <include refid="givebackJoins" />
- where wthbm =#{wthbm} and wtfbm = #{wtfbm} and dwbm= #{dwbm}
- </select>
- <select id="selectGivePassAll" resultType="com.unis.transaction.server.entity.givebackbail.GiveBackDO">
- SELECT
- *
- FROM ty_jybzjtk <include refid="givebackJoins" />
- where ccbm =#{ccbm}
- </select>
- <select id="selectDetails" resultType="com.unis.transaction.server.entity.givebackbail.GiveBackDO">
- SELECT
- *
- FROM ty_jybzjtk <include refid="givebackJoins" />
- <where>
- <if test="jybm != null and jybm != ''">
- and jybm = #{jybm}
- </if>
- <if test="sjlx != null and sjlx != ''">
- and sjlx = #{sjlx}
- </if>
- <if test="htbm != null and htbm != ''">
- and htbm = #{htbm}
- </if>
- <if test="ccbm != null and ccbm != ''">
- and ccbm = #{ccbm}
- </if>
- <if test="dwmc != null and dwmc != ''">
- and dwmc = #{dwmc}
- </if>
- <if test="dwbm != null and dwbm != ''">
- and dwbm = #{dwbm}
- </if>
- </where>
- </select>
- <select id="selectDetailByWthbms" resultType="com.unis.transaction.server.entity.givebackbail.GiveBackDO">
- SELECT
- *
- FROM ty_jybzjtk <include refid="givebackJoins" />
- where wthbm =#{wthbm} and wtfbm = #{wtfbm} and dwbm= #{dwbm}
- </select>
- <select id="selectGiveBackCjList" resultType="com.unis.transaction.common.vo.givebackbail.GiveBackVO">
- SELECT
- *
- FROM ty_jybzjtk <include refid="givebackJoins" />
- where tkfl=0 and sjlx = '1' and to_char(gqsj) like '%' || #{gqsj} || '%'
- </select>
-
- <insert id="insertGiveBack">
- INSERT INTO ty_jybzjtk(
- tkbm,jybm,wthbm,apcc,tkje,tksj,czr,tkpz,tkzt,tkztmc,remark)
- VALUES (
- #{tkbm},#{jybm},#{wthbm},#{apcc},#{tkje},#{tksj},#{czr},#{tkpz},#{tkzt},#{tkztmc},#{remark})
- </insert>
-
- <update id="updateGiveBackTkzt">
- UPDATE ty_jybzjtk SET
- tkzt = #{tkzt},tkztmc = #{tkztmc},wthbm = #{wthbm}
- WHERE
- <if test="apcc != null and apcc != ''">
- apcc = #{apcc}
- </if>
- <if test="jybm != null and jybm != ''">
- and jybm = #{jybm}
- </if>
- <if test="wtfbm != null and wtfbm != ''">
- and wtfbm = #{wtfbm}
- </if>
- <if test="dwbm != null and dwbm != ''">
- and dwbm = #{dwbm}
- </if>
- </update>
-
- <update id="deleteGiveBack">
- DELETE FROM ty_jybzjtk
- WHERE tkbm = #{tkbm}
- </update>
- <select id="selectGiveBackByCcbm" resultType="com.unis.transaction.common.vo.givebackbail.GiveBackVO">
- SELECT
- *
- FROM ty_jybzjtk <include refid="givebackJoins" />
- where ccbm = #{value}
- </select>
- <select id="selectGiveBackCjLists" resultType="com.unis.transaction.common.vo.givebackbail.GiveBackVO">
- SELECT
- *
- FROM ty_jybzjtk <include refid="givebackJoins" />
- where tkfl=0 and sjlx = '1' and ccbm= #{value}
- </select>
- </mapper>
|