AregMapper.xml 4.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
  3. <mapper namespace="com.cool.bang.modules.oracle.mapper.AregMapper">
  4. <resultMap id="AregMap" type="com.cool.bang.modules.oracle.domain.Areg">
  5. <id property="aregid" column="aregid"/>
  6. <result property="qybh" column="qybh" jdbcType="VARCHAR"/>
  7. <result property="xmbh" column="xmbh" jdbcType="VARCHAR"/>
  8. <result property="jgState" column="jgstate" jdbcType="INTEGER"/>
  9. <result property="jgje" column="jgje" jdbcType="DECIMAL"/>
  10. <result property="lcje" column="lcje" jdbcType="DECIMAL"/>
  11. <result property="tgzh" column="tgzh" jdbcType="VARCHAR"/>
  12. <result property="xmrq" column="xmrq" jdbcType="TIMESTAMP"/>
  13. <collection property="aregItemList" ofType="com.cool.bang.modules.oracle.domain.AregItem" >
  14. <result property="aregitemid" column="aregitemid" jdbcType="INTEGER"/>
  15. <result property="lzbh" column="lzbh" jdbcType="VARCHAR"/>
  16. <result property="bhpercent" column="bhpercent" jdbcType="INTEGER"/>
  17. <result property="jdpercent" column="jdpercent" jdbcType="INTEGER"/>
  18. <result property="propercent" column="propercent" jdbcType="INTEGER"/>
  19. <result property="progressname" column="progressname" jdbcType="VARCHAR"/>
  20. <result property="jgye" column="jgye" jdbcType="DECIMAL"/>
  21. <result property="tgye" column="tgye" jdbcType="DECIMAL"/>
  22. <result property="jgzt" column="jgzt" jdbcType="DECIMAL"/>
  23. <result property="jazj" column="jazj" jdbcType="INTEGER"/>
  24. <result property="lcbl" column="lcbl" jdbcType="DECIMAL"/>
  25. <result property="lcje" column="lcje" jdbcType="DECIMAL"/>
  26. <result property="jgzj" column="jgzj" jdbcType="DECIMAL"/>
  27. <result property="jgState" column="lz_jgstate" jdbcType="INTEGER"/>
  28. <result property="jzmj" column="jzmj" jdbcType="DECIMAL"/>
  29. <result property="lzrq" column="lzrq" jdbcType="TIMESTAMP"/>
  30. </collection>
  31. </resultMap>
  32. <select id="selectFromAreg" resultMap="AregMap">
  33. SELECT
  34. t1.aregid,
  35. t1.qybh,
  36. t1.xmbh,
  37. t1.jgstate,
  38. t1.zdmoney AS jgje,
  39. t2.lcje,
  40. t3.accountno AS tgzh,
  41. t2.aregitemid,
  42. t2.lzmc,
  43. t2.lzbh,
  44. t2.jiananzaojia AS jazj,
  45. t2.bhpercent,
  46. t2.jdpercent,
  47. t2.propercent,
  48. t2.progressname,
  49. t2.jzmj,
  50. t2.checkbalance AS tgye,
  51. t2.checkjgbalance AS jgye,
  52. t2.lcbl,
  53. t2.lcje,
  54. t2.zdmoney AS jgzj,
  55. t2.jgstate AS lz_jgstate,
  56. to_date(to_char(t4.SPJSSJ,'yyyy-mm-dd hh24:mi:ss'),'yyyy-mm-dd hh24:mi:ss') as xmrq,
  57. to_date(to_char(t5.SPJSSJ,'yyyy-mm-dd hh24:mi:ss'),'yyyy-mm-dd hh24:mi:ss') as lzrq
  58. FROM
  59. AREG t1
  60. LEFT JOIN AREGITEM t2 ON t1.aregid = t2.aregid
  61. LEFT JOIN account t3 ON t1.tgzhid = t3.accountid
  62. LEFT JOIN APPLY t4 on t1.aregid = t4.aregid AND t4.APPTYPE = 0 and t4.state = 1
  63. LEFT JOIN APPLY t5 on t2.appid = t5.appid AND t4.APPTYPE in (0, 2) and t4.state = 1
  64. WHERE
  65. t1.state = 1 and t1.jgzt != 0
  66. </select>
  67. <!-- 查询楼幢虚拟户托管在途资金 -->
  68. <select id="selectLzTgzt" resultType="java.math.BigDecimal">
  69. select sum(pl.money) from aregitem i,payitemlz pl, payitem p,apply a
  70. where a.appid =p.appid and p.payitemid =pl.payitemid and pl.aregitemid =i.aregitemid
  71. 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)
  72. and i.aregitemid = #{aregitemid}
  73. </select>
  74. <!-- 查询楼幢虚拟户监管在途资金 -->
  75. <select id="selectLzJgzt" resultType="java.math.BigDecimal">
  76. select sum(pl.money) from aregitem i,payitemlz pl, payitem p,apply a
  77. where a.appid =p.appid and p.payitemid =pl.payitemid and pl.aregitemid =i.aregitemid
  78. 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)
  79. and i.aregitemid = #{aregitemid}
  80. </select>
  81. </mapper>