123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212 |
- <?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.TurnoverDataDao">
-
- <sql id="turnoverdataColumns">
- cjbm,sfbm,sfmc,htbm,hth,bdbm,bdh,mfcckbm,mfcckmc,jhckbm,jhckmc,chbm,chmc,scnf,sflt,sgdjbm,sgdjmc,hhqydjbm,hhqydjmc,
- cjsl,zcjsl,lsxzbm,lsxzmc,lspzbm,lspzmc,qpjg,cjdj,cjje,cjrq,fhkjzrq,ckjzrq,cjdwbm,cjdwmc,dzjlx,jyjbh,ztbm,ztmc,
- hxdf,sscc,sjlx,
- wtf,sskd,sskdmc,ssqy,ssqymc,remark
- </sql>
- <sql id="turnoverdata">
- cj.sscc,cj.cc,cj.cjrq,cj.qysl,cj.cd,cj.wbqy,cj.lsxzbm,cj.lsxzmc,cj.lspzmc,cj.lspzbm,cj.jylx,cj.jyxz,cj.lspzbm,sum
- (cj.zcjsl)
- cjsl,round((sum(cj.cjje)/sum(cj.zcjsl)),2) pjj,
- sum(cj.cjje) cjje,avg(cj.sxf) sxf,avg(cj.qpjg) qpjg,sum(cj.trsl) trsl,sum(cj.zcjsl)
- lysl,round((sum(cj.zcjsl)/sum(cj.trsl)*100),2) lyl
- </sql>
-
- <sql id="turnoverdataJoins">
-
- </sql>
-
- <select id="selectList" resultType="com.unis.transaction.server.entity.creditevaluate.TurnoverDataDO" parameterType="com.unis.transaction.common.vo.creditevaluate.TurnoverDataVO">
- SELECT
- <include refid="turnoverdataColumns" />
- FROM ty_xycjsjwh <include refid="turnoverdataJoins" />
- <where>
- <if test="cjdwbm != null and cjdwbm != ''">
- and cjdwbm = #{cjdwbm}
- </if>
- <if test="cjbmList != null">
- and cjbm in
- <foreach collection="cjbmList" index="index" item="item" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- </where>
- </select>
- <select id="selectPageList" resultType="com.unis.transaction.common.vo.creditevaluate.TurnoverDataVO" parameterType="com.unis.transaction.common.vo.creditevaluate.TurnoverDataVO">
- SELECT
- <include refid="turnoverdata" />
- FROM ty_xycjsjwh cj<include refid="turnoverdataJoins" />
- <where>
- and cj.sjlx = '0'
- <if test="jylx != null">
- and cj.jylx = #{jylx}
- </if>
- <if test="jyxz != null and jyxz != ''">
- and cj.jyxz = #{jyxz}
- </if>
- <if test="lspzbm != null and lspzbm != ''">
- and cj.lspzbm = #{lspzbm}
- </if>
- <if test="lsxzbm != null and lsxzbm != ''">
- and cj.lsxzbm = #{lsxzbm}
- </if>
- <if test="cjrqStart != null">
- and cj.cjrq >= #{cjrqStart}
- </if>
- <if test="cjrqEnd != null">
- and cj.cjrq <= #{cjrqEnd}
- </if>
- <if test="cd != null and cd != ''">
- and cj.cd = #{cd}
- </if>
- </where>
- group by
- cj.sscc,cj.cc,cj.cd,cj.cjrq,cj.lsxzbm,cj.lsxzmc,cj.lspzmc,cj.lspzbm,cj.jylx,cj.jyxz,cj.lspzbm,cj.qysl,cj.wbqy
- order by
- cj.sscc desc
- </select>
- <select id="selectPageLists" resultType="com.unis.transaction.common.vo.creditevaluate.TurnoverDataVO"
- parameterType="com.unis.transaction.common.vo.creditevaluate.TurnoverDataVO">
- SELECT
- <include refid="turnoverdataColumns" />
- FROM ty_xycjsjwh <include refid="turnoverdataJoins" />
- <where>
- and status = 1
- <if test="cjdwmc != null and cjdwmc != ''">
- and cjdwmc like '%'||#{cjdwmc}||'%'
- </if>
- <if test="qyfj != null and qyfj != ''">
- and qyfj = #{qyfj}
- </if>
- <if test="hth != null and hth != ''">
- and hth like '%'||#{hth}||'%'
- </if>
- <if test="ztbm != null and ztbm != ''">
- and ztbm = #{ztbm}
- </if>
- <if test="lspzbm != null and lspzbm != ''">
- and lspzbm = #{lspzbm}
- </if>
- <if test="lsxzbm != null and lsxzbm != ''">
- and lsxzbm = #{lsxzbm}
- </if>
- <if test="cjrqStart != null">
- and cjrq >= #{cjrqStart}
- </if>
- <if test="cjrqEnd != null">
- and cjrq <= #{cjrqEnd}
- </if>
- <if test="cjdjStart != null">
- and cjdj >= #{cjdjStart}
- </if>
- <if test="cjdjEnd != null">
- and cjdj <= #{cjdjEnd}
- </if>
- </where>
- order by cjbm desc
- </select>
-
- <select id="selectDetail" resultType="com.unis.transaction.common.vo.creditevaluate.TurnoverDataVO" parameterType="com.unis.transaction.common.vo.creditevaluate.TurnoverDataVO">
- SELECT
- <include refid="turnoverdataColumns" />
- FROM ty_xycjsjwh <include refid="turnoverdataJoins" />
- WHERE cjbm = #{cjbm}
- </select>
-
- <select id="selectCjdwSummayDetail" resultType="com.unis.transaction.common.vo.creditevaluate.TurnoverDataVO" parameterType="com.unis.transaction.common.vo.creditevaluate.TurnoverDataVO">
- SELECT
- sum(hxdf) as hxdfTotal
- FROM ty_xycjsjwh <include refid="turnoverdataJoins" />
- WHERE cjbm = #{cjbm}
- </select>
-
- <select id="selectCjdwSummayPageList" resultType="com.unis.transaction.common.vo.creditevaluate.TurnoverDataVO" parameterType="com.unis.transaction.common.vo.creditevaluate.TurnoverDataVO">
- select
- hxzf as hxdf,
- cjdwmc,
- max( cjrq ) as cjrq,
- cjdwbm
- from
- ty_xycjsjwh
- <where>
- and status = 1
- <if test="cjdwmc != null and cjdwmc != ''">
- and cjdwmc like '%'||#{cjdwmc}||'%'
- </if>
- <if test="cjdwbm != null and cjdwbm != ''">
- and cjdwbm =#{cjdwbm}
- </if>
- <!--<if test="qyfj != null and qyfj != ''">
- and qyfj = #{qyfj}
- </if>-->
- <if test="hxdfStart != null and hxdfEnd != null">
- and hxzf >= #{hxdfStart} and hxzf < #{hxdfEnd}
- </if>
- <if test="hxdfStart != null and hxdfEnd == null">
- and hxzf < #{hxdfStart}
- </if>
- <if test="hxdfStart == null and hxdfEnd != null">
- and hxzf >= #{hxdfEnd}
- </if>
- </where>
- group by cjdwbm,cjdwmc,hxzf
- </select>
- <select id="selectZtbmByDwbm" resultType="com.unis.transaction.common.vo.creditevaluate.TurnoverDataVO">
- select
- cjdwmc,
- cjdwbm,
- hxzf,
- ztbm
- from
- ty_xycjsjwh
- <where>
- AND status =1
- <if test="cjdwbm != null and cjdwbm != ''">
- and cjdwbm =#{cjdwbm}
- </if>
- <if test="ztbm != null and ztbm != ''">
- and ztbm = #{ztbm}
- </if>
- </where>
- </select>
-
- <insert id="insertTurnoverData">
- INSERT INTO ty_xycjsjwh(
- cjbm,sfbm,sfmc,htbm,hth,bdbm,bdh,mfcckbm,mfcckmc,jhckbm,jhckmc,chbm,chmc,scnf,sflt,sgdjbm,sgdjmc,hhqydjbm,hhqydjmc,cjsl,zcjsl,lsxzbm,lsxzmc,lspzbm,lspzmc,qpjg,cjdj,cjje,cjrq,fhkjzrq,ckjzrq,cjdwbm,cjdwmc,dzjlx,jyjbh,ztbm,ztmc,hxdf,cc,wtf,sskd,sskdmc,ssqy,ssqymc)
- VALUES (
- #{cjbm},#{sfbm},#{sfmc},#{htbm},#{hth},#{bdbm},#{bdh},#{mfcckbm},#{mfcckmc},#{jhckbm},#{jhckmc},#{chbm},#{chmc},#{scnf},#{sflt},#{sgdjbm},#{sgdjmc},#{hhqydjbm},#{hhqydjmc},#{cjsl},#{zcjsl},#{lsxzbm},#{lsxzmc},#{lspzbm},#{lspzmc},#{qpjg},#{cjdj},#{cjje},#{cjrq},#{fhkjzrq},#{ckjzrq},#{cjdwbm},#{cjdwmc},#{dzjlx},#{jyjbh},#{ztbm},#{ztmc},#{hxdf},#{cc},#{wtf},#{sskd},#{sskdmc},#{ssqy},#{ssqymc})
- </insert>
-
- <update id="updateTurnoverData">
- UPDATE ty_xycjsjwh SET
- cjbm = #{cjbm},sfbm = #{sfbm},sfmc = #{sfmc},htbm = #{htbm},hth = #{hth},bdbm = #{bdbm},bdh = #{bdh},mfcckbm = #{mfcckbm},mfcckmc = #{mfcckmc},jhckbm = #{jhckbm},jhckmc = #{jhckmc},chbm = #{chbm},chmc = #{chmc},scnf = #{scnf},sflt = #{sflt},sgdjbm = #{sgdjbm},sgdjmc = #{sgdjmc},hhqydjbm = #{hhqydjbm},hhqydjmc = #{hhqydjmc},cjsl = #{cjsl},zcjsl = #{zcjsl},lsxzbm = #{lsxzbm},lsxzmc = #{lsxzmc},lspzbm = #{lspzbm},lspzmc = #{lspzmc},qpjg = #{qpjg},cjdj = #{cjdj},cjje = #{cjje},cjrq = #{cjrq},fhkjzrq = #{fhkjzrq},ckjzrq = #{ckjzrq},cjdwbm = #{cjdwbm},cjdwmc = #{cjdwmc},dzjlx = #{dzjlx},jyjbh = #{jyjbh},ztbm = #{ztbm},ztmc = #{ztmc},hxdf = #{hxdf},cc = #{cc},wtf = #{wtf},sskd = #{sskd},sskdmc = #{sskdmc},ssqy = #{ssqy},ssqymc = #{ssqymc}
- WHERE cjbm = #{cjbm}
- </update>
-
- <update id="deleteTurnoverData">
- DELETE FROM ty_xycjsjwh
- WHERE cjbm = #{cjbm}
- </update>
- <update id="updateHxdfByDwbm">
- UPDATE ty_xycjsjwh cj set cj.hxdf =0,cj.hxzf =0
- WHERE
- <if test="cjdwbm != null and cjdwbm != ''">
- cjdwbm = #{cjdwbm}
- </if>
- <if test="cjrq != null">
- and cjrq > #{cjrq}
- </if>
- </update>
- <update id="updateHxzfByDwbm">
- UPDATE ty_xycjsjwh cj set cj.hxzf =#{hxzf}
- WHERE
- <if test="cjdwbm != null and cjdwbm != ''">
- cjdwbm = #{cjdwbm}
- </if>
- </update>
-
- </mapper>
|