1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586 |
- <?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.cool.bang.modules.oracle.mapper.AregMapper">
- <resultMap id="AregMap" type="com.cool.bang.modules.oracle.domain.Areg">
- <id property="aregid" column="aregid"/>
- <result property="qybh" column="qybh" jdbcType="VARCHAR"/>
- <result property="xmbh" column="xmbh" jdbcType="VARCHAR"/>
- <result property="jgState" column="jgstate" jdbcType="INTEGER"/>
- <result property="jgje" column="jgje" jdbcType="DECIMAL"/>
- <result property="lcje" column="lcje" jdbcType="DECIMAL"/>
- <result property="tgzh" column="tgzh" jdbcType="VARCHAR"/>
- <result property="xmrq" column="xmrq" jdbcType="TIMESTAMP"/>
- <collection property="aregItemList" ofType="com.cool.bang.modules.oracle.domain.AregItem" >
- <result property="aregitemid" column="aregitemid" jdbcType="INTEGER"/>
- <result property="lzbh" column="lzbh" jdbcType="VARCHAR"/>
- <result property="bhpercent" column="bhpercent" jdbcType="INTEGER"/>
- <result property="jdpercent" column="jdpercent" jdbcType="INTEGER"/>
- <result property="propercent" column="propercent" jdbcType="INTEGER"/>
- <result property="progressname" column="progressname" jdbcType="VARCHAR"/>
- <result property="jgye" column="jgye" jdbcType="DECIMAL"/>
- <result property="tgye" column="tgye" jdbcType="DECIMAL"/>
- <result property="jgzt" column="jgzt" jdbcType="DECIMAL"/>
- <result property="jazj" column="jazj" jdbcType="INTEGER"/>
- <result property="lcbl" column="lcbl" jdbcType="DECIMAL"/>
- <result property="lcje" column="lcje" jdbcType="DECIMAL"/>
- <result property="jgzj" column="jgzj" jdbcType="DECIMAL"/>
- <result property="jgState" column="lz_jgstate" jdbcType="INTEGER"/>
- <result property="jzmj" column="jzmj" jdbcType="DECIMAL"/>
- <result property="lzrq" column="lzrq" jdbcType="TIMESTAMP"/>
- </collection>
- </resultMap>
- <select id="selectFromAreg" resultMap="AregMap">
- SELECT
- t1.aregid,
- t1.qybh,
- t1.xmbh,
- t1.jgstate,
- t1.zdmoney AS jgje,
- t2.lcje,
- t3.accountno AS tgzh,
- t2.aregitemid,
- t2.lzmc,
- t2.lzbh,
- t2.jiananzaojia AS jazj,
- t2.bhpercent,
- t2.jdpercent,
- t2.propercent,
- t2.progressname,
- t2.jzmj,
- t2.checkbalance AS tgye,
- t2.checkjgbalance AS jgye,
- t2.lcbl,
- t2.lcje,
- t2.zdmoney AS jgzj,
- t2.jgstate AS lz_jgstate,
- to_date(to_char(t4.SPJSSJ,'yyyy-mm-dd hh24:mi:ss'),'yyyy-mm-dd hh24:mi:ss') as xmrq,
- to_date(to_char(t5.SPJSSJ,'yyyy-mm-dd hh24:mi:ss'),'yyyy-mm-dd hh24:mi:ss') as lzrq
- FROM
- AREG t1
- LEFT JOIN AREGITEM t2 ON t1.aregid = t2.aregid
- LEFT JOIN account t3 ON t1.tgzhid = t3.accountid
- LEFT JOIN APPLY t4 on t1.aregid = t4.aregid AND t4.APPTYPE = 0 and t4.state = 1
- LEFT JOIN APPLY t5 on t2.appid = t5.appid AND t4.APPTYPE in (0, 2) and t4.state = 1
- WHERE
- t1.state = 1 and t1.jgzt != 0
- </select>
- <!-- 查询楼幢虚拟户托管在途资金 -->
- <select id="selectLzTgzt" resultType="java.math.BigDecimal">
- select sum(pl.money) from aregitem i,payitemlz pl, payitem p,apply a
- where a.appid =p.appid and p.payitemid =pl.payitemid and pl.aregitemid =i.aregitemid
- and a.state ='1' and p.state ='1' and pl.state ='1' and a.apptype in ('18','19') and p.paycode not in (select t.tradenum from trade t where t.tradestate ='1' and t.tradenum is not null)
- and i.aregitemid = #{aregitemid}
- </select>
- <!-- 查询楼幢虚拟户监管在途资金 -->
- <select id="selectLzJgzt" resultType="java.math.BigDecimal">
- select sum(pl.money) from aregitem i,payitemlz pl, payitem p,apply a
- where a.appid =p.appid and p.payitemid =pl.payitemid and pl.aregitemid =i.aregitemid
- and a.state ='1' and p.state ='1' and pl.state ='1' and a.apptype in ('6','7') and p.paycode not in (select t.tradenum from trade t where t.tradestate ='1' and t.tradenum is not null)
- and i.aregitemid = #{aregitemid}
- </select>
- </mapper>
|