123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180 |
- <?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.tofly.feesapi.bjgl.mapper.YhCbkxxMapper">
-
- <select id="SelectYhcbkxx" resultType="com.tofly.feesapi.bjgl.entity.YhCbkxx2">
- select * from yh_cbkxx where 1=1
- <if test="yhbh!=null and yhbh!=''">
- and yhbh=#{yhbh}
- </if>
- <if test="cbkh!=null and cbkh!=''">
- and cbkh=#{cbkh}
- </if>
- </select>
-
- <select id="selectExistYhbh" resultType="int">
- SELECT COUNT(0) sl FROM yh_cbkxx WHERE yhbh=#{yhbh} and cbkh#{cbkh}
- </select>
-
- <select id="getYhdaSbdaPage" resultType="com.tofly.feesapi.bjgl.entity.YhDaCbkxxSelect">
- select a.yhbh,a.yhxm,a.yhdz,a.lxdh,a.ssgs,a.sscbpq,a.sscbb,b.sblb,b.sbsccj,b.sbbh,b.sblc,b.sbxh,b.sbkj,b.bjwz from yh_khjbxx a,yh_cbkxx b where a.yhbh=b.yhbh
-
- <if test="searchText!=null">
- AND ( a.yhbh like '%${searchText}%'
- OR a.yhxm like '%${searchText}%'
- OR a.yhdz like '%${searchText}%'
- OR a.lxdh like '%${searchText}%')
- </if>
- <if test="sscbpq!=null and sscbpq!=''">
- and a.sscbpq=#{sscbpq}
- </if>
- <if test="sscbb!=null and sscbb!=''">
- and a.sscbb=#{sscbb}
- </if>
- </select>
-
- <select id="SelectYhdaSbda" resultType="com.tofly.feesapi.bjgl.entity.YhDaCbkxxSelect">
- select a.yhbh,a.yhxm,a.yhdz,a.lxdh,a.ssgs,a.sscbpq,a.sscbb,b.sblb,b.sbsccj,b.sbbh,b.sblc,b.sbxh,b.sbkj,b.bjwz from yh_khjbxx a,yh_cbkxx b where a.yhbh=b.yhbh
- <if test="yhbh!=null and yhbh!=''">
- and a.yhbh=#{yhbh}
- </if>
- <if test="cbkh!=null and cbkh!=''">
- and b.cbkh=#{cbkh}
- </if>
- </select>
- <select id="getList" resultType="com.tofly.feesapi.bjgl.entity.vo.YhCbkxxSelect">
- SELECT yhbh, cbkh, cbkid, c.name AS sblbmc, d.name AS sbsccjmc, sbccrq,
- e.name AS sbxhmc, f.ccname AS sbkjmc, sbbh, b.name sjmc, jfzt
- FROM yh_cbkxx a
- LEFT JOIN bm_sj b ON a.sjbm = b.code
- LEFT JOIN bm_sblb c ON a.sblb = c.code
- LEFT JOIN bm_sbsccj d ON a.sbsccj = d.code
- LEFT JOIN bm_sbxh e ON a.sbxh = e.code
- LEFT JOIN (SELECT * FROM sys_child_code WHERE pcid='12') f ON a.sbkj = f.cccode
- WHERE a.yhbh=#{yhbh}
- </select>
-
- <select id="getPage" resultType="com.tofly.feesapi.bjgl.entity.vo.YhCbkxxSelect2">
- <include refid="sql2"></include>
- </select>
- <sql id="sql2">
- SELECT a.yhbh, a.cbkh, c.yhxm, c.yhdz, a.ybdjbz, a.wsfbz, a.sjbm, a.sjbm1, a.slbl1, a.sjbm2, a.slbl2, a.sjbm3, a.slbl3, a.cbxh, f.cbbmc AS sscbbmc
- FROM yh_cbkxx a
- LEFT JOIN yh_khjbxx c ON a.yhbh = c.yhbh
- LEFT JOIN bm_cbb f ON c.sscbb = f.cbbbm
- WHERE 1=1
-
- <if test="filter.searchText!=null">
- AND ( c.yhbh like '%${filter.searchText}%'
- OR c.yhxm like '%${filter.searchText}%'
- OR c.yhdz like '%${filter.searchText}%'
- OR c.lxdh like '%${filter.searchText}%')
- </if>
-
- <if test="filter.ssgs!=null">
- AND c.ssgs=#{filter.ssgs}
- </if>
-
- <if test="filter.sscbpq!=null">
- AND c.sscbpq=#{filter.sscbpq}
- </if>
-
- <if test="filter.sscbb!=null">
- AND c.sscbb=#{filter.sscbb}
- </if>
-
- <if test="filter.yhzt!=null">
- AND c.yhzt=#{filter.yhzt}
- </if>
-
- <if test="filter.ljfbz!=null">
- AND a.ljfbz=#{filter.ljfbz}
- </if>
-
- <if test="filter.jdrqStart!=null and filter.jdrqEnd!=null">
- AND TRUNC(c.jdrq) BETWEEN #{filter.jdrqStart} AND
- #{filter.jdrqEnd}
- </if>
-
- <if test="filter.yhxm!=null">
- AND c.yhxm=#{filter.yhxm}
- </if>
-
- <if test="filter.yhbh!=null">
- AND c.yhbh=#{filter.yhbh}
- </if>
-
- <if test="filter.yhdz!=null">
- AND c.yhdz=#{filter.yhdz}
- </if>
-
- <if test="filter.lxdh!=null">
- AND c.lxdh=#{filter.lxdh}
- </if>
-
- <if test="filter.sffpcbb!=null">
- <if test="filter.sffpcbb">
- AND c.sscbb IS NOT NULL
- </if>
- <if test="!filter.sffpcbb">
- AND c.sscbb IS NULL
- </if>
- </if>
-
- <if test="filter.cbxh!=null">
- AND a.cbxh=#{filter.cbxh}
- </if>
-
- <if test="filter.sffpcbxh!=null">
- <if test="filter.sffpcbxh">
- AND (a.cbxh IS NOT NULL AND a.cbxh > 0)
- </if>
- <if test="!filter.sffpcbxh">
- AND (a.cbxh IS NULL OR a.cbxh = 0)
- </if>
- </if>
- </sql>
- <select id="getMaxCbxh" resultType="Integer">
- SELECT NVL(MAX(cbxh),0) AS cbxh FROM yh_cbkxx WHERE yhbh IN
- <foreach collection="yhbhs" item="yhbh" index="index" open="(" close=")" separator=",">
- #{yhbh}
- </foreach>
- </select>
- <select id="getUp" resultType="com.tofly.feesapi.bjgl.entity.YhCbkxx">
- SELECT
- c.sscbb,
- a.*
- FROM
- yh_cbkxx a
- LEFT JOIN yh_khjbxx c ON
- a.yhbh = c.yhbh
- WHERE
- c.sscbb = #{sscbb}
- AND ${cbxh} > a.cbxh
- AND a.cbxh > 0
- AND ROWNUM = 1
- ORDER BY
- a.cbxh
- </select>
- <select id="getDown" resultType="com.tofly.feesapi.bjgl.entity.YhCbkxx">
- SELECT
- c.sscbb,
- a.*
- FROM
- yh_cbkxx a
- LEFT JOIN yh_khjbxx c ON
- a.yhbh = c.yhbh
- WHERE
- c.sscbb = #{sscbb}
- AND a.cbxh > ${cbxh}
- AND a.cbxh > 0
- AND ROWNUM = 1
- ORDER BY
- a.cbxh
- </select>
- </mapper>
|