123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425 |
- <?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.TransactionSignUpDao">
-
- <sql id="transactionsignupColumns">
- jybm,bdbm,bdh,apcc,sl,je,lsxz,lsxzmc,lslb,lslbmc,dwbm,dwmc,lxdh,bzj,sxfl,bmrq,fjid,
- spr,shzt,shztmc,shyj,shsj,hkje,hksj,hkdwbm,hkdwmc,hkpz,skzt,skztmc,tkzt,tkztmc,remark
- ,lspzbm,lspzmc
- </sql>
-
- <sql id="transactions">
- bm.jybm as jybm,
- bm.dwmc as dwmc,
- bm.jyfx as jyfx,
- bm.jyfxmc as jyfxmc,
- bm.jyfs as jyfs,
- bm.jyfsmc as jyfsmc,
- bm.bmrq as bmrq,
- bm.lxdh as lxdh,
- bm.sxfl as sxfl,
- bm.shzt as shzt,
- bm.shztmc as shztmc,
- bm.fjid as fjid,
- bm.wtbm as wtbm,
- bm.ccbm as ccbm,
- bm.bdh as bdh,
- bm.sl as sl,
- bm.yxsl as yxsl,
- bm.apcc as apcc,
- bm.jybzj as jybzj,
- bm.lybzj as lybzj,
- bm.jkje jkje
- </sql>
-
- <sql id="transaction">
- bm.jybm as jybm,
- bm.dwmc as dwmc,
- bm.bmrq as bmrq,
- bm.lxdh as lxdh,
- bm.sxfl as sxfl,
- bm.shzt as shzt,
- bm.skzt as skzt,
- bm.skztmc as skztmc,
- bm.shztmc as shztmc,
- bm.fjid as fjid,
- bm.wtbm as wtbm,
- cc.ccbm as ccbm,
- cc.zt as zt,
- bm.bdh as bdh,
- cc.sl as sl,
- cc.apcc as apcc,
- cc.bzj as bzj,
- wt.jyrq as jyrq,
- wt.pzmc as lspzmc
- </sql>
-
- <sql id="transactionsignupJoins">
-
- </sql>
-
- <select id="selectList" resultType="com.unis.transaction.server.entity.signuppay.TransactionSignUpDO" parameterType="com.unis.transaction.common.vo.signuppay.TransactionSignUpVO">
- SELECT
- <include refid="transactionsignupColumns" />
- FROM ty_jybm <include refid="transactionsignupJoins" />
- <where>
- and status = 1
- <if test="shzt != null and shzt != ''">
- and shzt = #{shzt}
- </if>
- </where>
- </select>
-
- <select id="selectPageLists" resultType="com.unis.transaction.common.vo.signuppay.TransactionSignUpVO" parameterType="com.unis.transaction.common.vo.signuppay.TransactionSignUpVO">
- SELECT
- <include refid="transactions" />
- FROM ty_jybm bm
- left join ty_jycrkwt wt on bm.wtbm = wt.wtbm
- <where>
- and bm.status = 1
- <if test="shztList != null">
- and bm.shzt in
- <foreach collection="shztList" index="index" item="item" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
-
- <if test="apcc != null and apcc != ''">
- and bm.apcc like '%'||#{apcc}||'%'
- </if>
- <if test="dwmc != null and dwmc != ''">
- and bm.dwmc like '%'||#{dwmc}||'%'
- </if>
- <if test="bmrqStart != null">
- and bm.bmrq >= #{bmrqStart}
- </if>
- <if test="bmrqEnd != null">
- and bm.bmrq <= #{bmrqEnd}
- </if>
- <if test="shsjStart != null">
- and bm.shsj >= #{shsjStart}
- </if>
- <if test="shsjEnd != null">
- and bm.shsj <= #{shsjEnd}
- </if>
- </where>
- order by bm.ccbm desc
- </select>
-
- <select id="selectTransactionSignPageList" resultType="com.unis.transaction.common.vo.signuppay.TransactionSignUpVO" parameterType="com.unis.transaction.common.vo.signuppay.TransactionSignUpVO">
- select cc.wtfmc, cc.jyfx, cc.jyfs,
- decode(cc.jyfx, '0', '采购', '1', '销售', '0,1', '采购,销售', '') jyfxmc,
- decode(cc.jyfs, '0', '竞价', '1', '挂牌', '2', '购销双向', '') jyfsmc,
- cc.ccbm, cc.zt, cc.apcc, cc.wtbm, cc.jybzj, cc.lybzj, cc.sl, cc.jyrq,
- bm.bmrq, bm.shzt, bm.shztmc, bm.jybm
- from (select * from ty_jycc where cczt='已发布') cc
- left join (select * from ty_jybm
- <where>
- <if test="dwbm != null and dwbm != ''">
- and dwbm =#{dwbm}
- </if>
- <if test="shztList != null">
- and shzt in
- <foreach collection="shztList" index="index" item="item" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- </where>
- ) bm on cc.ccbm = bm.ccbm
- <where>
- <!-- <if test="shzt !='91000079'.toString() and shzt !='1'.toString() and shzt !=''">
- and cc.zt=1 and bm.jybm is not null
- </if>
- <if test="shzt == '1'.toString()">
- and cc.zt=1 and bm.jybm is null
- </if>
- <if test="shzt=='91000079'.toString()">
- and cc.zt=0 and bm.jybm is null
- </if> -->
- <!-- 未报名 -->
- <if test="shzt == '1'.toString()">
- and cc.zt !=0 and bm.shzt is null
- </if>
- <!-- 除未报名和已过期外的-->
- <if test="shzt != '1'.toString() and shzt !='91000079'.toString()">
- <if test="shztList != null">
- and bm.shzt in
- <foreach collection="shztList" index="index" item="item" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- </if>
- <!-- 已过期 -->
- <if test="shzt=='91000079'.toString()">
- and cc.zt=0 and bm.jybm is null
- </if>
- <if test="apcc != null and apcc != '' and shzt == '1'.toString()">
- and cc.apcc like '%'||#{apcc}||'%'
- </if>
- <if test="apcc != null and apcc != '' and shzt != '1'.toString() and shzt == ''">
- and cc.apcc like '%'||#{apcc}||'%'
- </if>
- <if test="apcc != null and apcc != '' and shzt != '1'.toString() and shzt != ''">
- and bm.apcc like '%'||#{apcc}||'%'
- </if>
- <if test="bmrqEnd != null">
- and bm.bmrq <= #{bmrqEnd}
- </if>
- <if test="bmrqStart != null">
- and bm.bmrq >= #{bmrqStart}
- </if>
- </where>
- order by cc.jyrq desc, bm.bmrq desc
- </select>
-
- <select id="selectPageList" resultType="com.unis.transaction.common.vo.signuppay.TransactionSignUpVO" parameterType="com.unis.transaction.common.vo.signuppay.TransactionSignUpVO">
- select * from (SELECT
- <include refid="transaction" />
- FROM
- <if test="shztList == null and shzt == '1'.toString()">
- (select * from ty_jycc where ccbm not in(select ccbm from ty_jybm) and zt=1 )cc
- </if>
- <if test="shzt != null and shzt =='91000079'.toString() ">
- (select * from ty_jycc where ccbm not in(select ccbm from ty_jybm
- ) and zt=0 ) cc
- </if>
- <if test="shztList == null and shzt == ''">
- ty_jycc cc
- </if>
- <if test="shztList != null and shzt != '' and shzt != '1'">
- ty_jycc cc
- </if>
- join ty_jycrkwt wt on cc.wtbm = wt.wtbm
- <if test="apcc != null and apcc != ''">
- and cc.apcc like '%'||#{apcc}||'%'
- </if>
- <if test="shztList == null and shzt!=null and shzt == ''">
- left join ty_jybm bm on cc.ccbm = bm.ccbm and cc.cczt='已发布'
- </if>
- <if test="shztList == null and shzt!=null and shzt == '1'.toString()">
- left join ty_jybm bm on cc.ccbm = bm.ccbm and cc.cczt='已发布'
- </if>
- <if test="shztList == null and shzt!=null and shzt == '91000079'.toString()">
- left join ty_jybm bm on cc.ccbm = bm.ccbm and cc.cczt='已发布'
- </if>
- <if test="shztList != null">
- join ty_jybm bm on cc.ccbm = bm.ccbm and cc.cczt='已发布'
- </if>
- <if test="shztList != null">
- and bm.shzt in
- <foreach collection="shztList" index="index" item="item" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
-
- <if test="dwmc != null and dwmc != ''">
- and bm.dwmc like '%'||#{dwmc}||'%'
- </if>
- <if test="dwbm != null and dwbm != ''">
- and bm.dwbm =#{dwbm}
- </if>
- <if test="shsjStart != null">
- and bm.shsj >= #{shsjStart}
- </if>
- <if test="shsjEnd != null">
- and bm.shsj <= #{shsjEnd}
- </if>
- order by bm.jybm desc) ts
- <where>
- <if test="bmrqStart != null">
- and ts.bmrq >= #{bmrqStart}
- </if>
- <if test="bmrqEnd != null">
- and ts.bmrq <= #{bmrqEnd}
- </if>
- </where>
- order by ccbm desc
- </select>
-
- <select id="selectDetail" resultType="com.unis.transaction.common.vo.signuppay.TransactionSignUpVO" parameterType="com.unis.transaction.common.vo.signuppay.TransactionSignUpVO">
- SELECT
- <include refid="transaction" />
- FROM ty_jycc cc
- left join ty_jycrkwt wt on cc.wtbm = wt.wtbm
- left join ty_jybm bm on cc.ccbm = bm.ccbm
- and cc.cczt='已发布'
- and cc.ccbm=#{value}
- </select>
-
- <insert id="insertTransactionSignUp">
- INSERT INTO ty_jybm(
- jybm,bdbm,bdh,apcc,sl,je,lsxz,lsxzmc,lslb,lslbmc,dwbm,dwmc,lxdh,bzj,sxfl,bmrq,fjid,spr,shzt,shztmc,shyj,shsj,hkje,hksj,hkdwbm,hkdwmc,hkpz,skzt,skztmc,tkzt,tkztmc,remark,lspzbm,lspzmc)
- VALUES (
- #{jybm},#{bdbm},#{bdh},#{apcc},#{sl},#{je},#{lsxz},#{lsxzmc},#{lslb},#{lslbmc},#{dwbm},#{dwmc},#{lxdh},#{bzj},#{sxfl},#{bmrq},#{fjid},#{spr},#{shzt},#{shztmc},#{shyj},#{shsj},#{hkje},#{hksj},#{hkdwbm},#{hkdwmc},#{hkpz},#{skzt},#{skztmc},#{tkzt},#{tkztmc},#{remark},#{lspzbm},#{lspzmc})
- </insert>
-
- <update id="updateTransactionSignUp">
- UPDATE ty_jybm SET
- jybm = #{jybm},bdbm = #{bdbm},bdh = #{bdh},apcc = #{apcc},sl = #{sl},je = #{je},lsxz = #{lsxz},lsxzmc = #{lsxzmc},lslb = #{lslb},lslbmc = #{lslbmc},dwbm = #{dwbm},dwmc = #{dwmc},lxdh = #{lxdh},bzj = #{bzj},sxfl = #{sxfl},bmrq = #{bmrq},fjid = #{fjid},spr = #{spr},shzt = #{shzt},shztmc = #{shztmc},shyj = #{shyj},shsj = #{shsj},hkje = #{hkje},hksj = #{hksj},hkdwbm = #{hkdwbm},hkdwmc = #{hkdwmc},hkpz = #{hkpz},skzt = #{skzt},skztmc = #{skztmc},tkzt = #{tkzt},tkztmc = #{tkztmc},remark = #{remark},lspzbm = #{lspzbm},lspzmc = #{lspzmc}
- WHERE jybm = #{jybm}
- </update>
-
- <update id="deleteTransactionSignUp">
- DELETE FROM ty_jybm
- WHERE jybm = #{jybm}
- </update>
-
- <select id="selectSceneList" resultType="com.unis.transaction.common.vo.signuppay.SceneVO">
- select
- bd.bdbm,
- bd.sl,
- ap.pzbm,
- ap.pzmc,
- bd.apcc
- from
- ty_jybd bd
- join ty_jycrkap ap on bd.apbm = ap.apbm
- left join ty_jybm bm on bm.apcc = bd.apcc and bm.status=1
- where bm.apcc is null
- </select>
-
- <select id="selectListNotInGiveBackBail" resultType="com.unis.transaction.common.vo.signuppay.TransactionSignUpVO">
- select apcc,ccbm from ty_jybm
- <where>
- jybm in (select jybm from ty_jybzjtk where tkfl ='0' ) and wtfbm = #{dwbm}
- <if test="htList != null">
- and ccbm in (
- select ccbm from ty_jybd where bdh in (select bdh from ty_jyht
- where htbm not in
- <foreach collection="htList" index="index" item="item" open="(" separator="," close=")">
- #{item}
- </foreach>
- )
- )
- </if>
- </where>
- order by ccbm desc
- </select>
- <select id="selectTransByCcbm" resultType="com.unis.transaction.server.entity.signuppay.TransactionSignUpDO">
- select * from ty_jybm ty where ty.ccbm=#{ccbm} and ty.creator_code = #{userId}
- </select>
-
- <select id="selectTransactionSignUpList" resultType="com.unis.transaction.common.vo.signuppay.TransactionSignUpVO">
- SELECT
- <include refid="transaction" />
- FROM (select * from ty_jycc where ccbm not in(select ccbm from ty_jybm) and zt =1) cc
- join ty_jycrkwt wt on cc.wtbm = wt.wtbm
- left join ty_jybm bm on cc.ccbm = bm.ccbm and cc.cczt='已发布'
- </select>
-
- <select id="selectListByCC" resultType="com.unis.transaction.server.entity.signuppay.TransactionSignUpDO"
- parameterType="java.lang.String">
- select jybm,dwbm,dwmc from ty_jybm where ccbm = #{value}
- </select>
- <select id="selectLists" resultType="com.unis.transaction.server.entity.signuppay.TransactionSignUpDO">
- SELECT
- DISTINCT dwbm,dwmc
- FROM ty_jybm where dwbm is not null
- </select>
-
- <select id="selectByDwbmAndCcbm" resultType="com.unis.transaction.server.entity.signuppay.TransactionSignUpDO">
- select * from ty_jybm where dwmc = #{dwmc} and ccbm = #{ccbm}
- </select>
-
- <select id="selectDwbmList" resultType="com.unis.transaction.common.vo.signuppay.TransactionSignUpVO">
- select DISTINCT dwbm,dwmc from ty_jybm where shzt = #{shzt} and ccbm = #{ccbm}
- </select>
- <select id="selectSiteAll" resultType="com.unis.transaction.server.entity.signuppay.TransactionSignUpDO">
- select distinct apcc,ccbm from ty_jybm
- where
- ccbm in
- (select ccbm from ty_jybd where bdbm in
- (select bdbm from ty_jyht where (sgdw=#{dwbm} or cmdw = #{dwbm})
- <if test="htList != null">
- and htbm not in
- <foreach collection="htList" index="index" item="item" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- )) order by ccbm desc
- </select>
-
- <select id="selectTranPageList" resultType="com.unis.transaction.common.vo.signuppay.TransactionSignUpVO">
- select * from ty_jybm
- <where>
- <if test="wtfbm != null and wtfbm !=''">
- and wtfbm = #{wtfbm}
- </if>
- <if test="dwbm != null and dwbm !=''">
- and dwbm = #{dwbm}
- </if>
- <if test="shzt != null and shzt !=''">
- and shzt = #{shzt}
- </if>
- <if test="apcc != null and apcc !=''">
- and apcc like '%'||#{apcc}||'%'
- </if>
- <if test="bmrqEnd != null">
- and bmrq <= #{bmrqEnd}
- </if>
- <if test="bmrqStart != null">
- and bmrq >= #{bmrqStart}
- </if>
- </where>
- order by jyrq desc, to_date(jysj, 'hh24:mi') desc
- </select>
-
- <select id="selectSiteAllNotice"
- resultType="com.unis.transaction.server.entity.signuppay.TransactionSignUpDO">
- select distinct apcc,ccbm from ty_jybm where ccbm in
- (select ccbm from ty_jybd where bdbm in
- (select bdbm from ty_jyht where htbm not in (select htbm from ty_jytkwth
- where zt <> #{zt})
- )) order by ccbm desc
- </select>
- <select id="selectSkztList" resultType="com.unis.transaction.common.vo.signuppay.TransactionSignUpVO">
- select DISTINCT dwbm,dwmc from ty_jybm where skzt = #{skzt} and ccbm = #{ccbm}
- </select>
- <select id="selectSkztListNew" resultType="com.unis.transaction.common.vo.signuppay.TransactionSignUpVO">
- select DISTINCT dwbm,dwmc from ty_jybm
- <where>
- <if test="skzt != null">
- and skzt = #{skzt}
- </if>
- <if test="ccbm != null and ccbm !=''">
- and ccbm = #{ccbm}
- </if>
- <if test="bdh != null and bdh !=''">
- and yxbd like '%' || #{bdh} || '%'
- </if>
- </where>
- </select>
- <select id="getGqsj" resultType="java.lang.String">
- select first 1 gqsj from ty_jybzjtk where ccbm = #{value}
- </select>
-
- <update id="updateSignUpTkzt">
- UPDATE ty_jybm SET
- tkzt = #{tkzt},tkztmc = #{tkztmc}
- WHERE apcc = #{apcc}
- </update>
-
- <select id="getSignUpBeforeDataCcbm" resultType="com.unis.transaction.common.vo.signuppay.TransactionSignUpVO">
- select
- wt.wtbm,
- wt.wtbh,
- wt.jyfx,
- wt.jyfxmc,
- wt.jyfs,
- wt.jyfsmc,
- cc.ccbm,
- cc.apcc,
- cc.jyrq as jyrq,
- cc.jysj,
- cc.jybzj,
- cc.lybzj
- from ty_jycc cc
- left join ty_jycrkwt wt on cc.wtbm = wt.wtbm
- where cc.ccbm = #{ccbm}
- </select>
- <select id="selectdwbmByTyshxydm" resultType="java.lang.String">
- select qy.qyjgdm from base:tz_slqy qy where qy.tyshxydm=#{tyshxydm}
- </select>
-
- </mapper>
|