OracleMapper.xml 3.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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.OracleMapper">
  4. <select id="selectFromBxm" resultType="java.util.Map">
  5. select t1.*, t2.qymc, t3.SPJSSJ from BXM t1
  6. left join BQY t2 on t1.qybh = t2.qybh
  7. left join (select t.* from (select t.XMBH, to_date(to_char(t2.SPJSSJ,'yyyy-mm-dd hh24:mi:ss'),'yyyy-mm-dd hh24:mi:ss') as SPJSSJ, ROW_NUMBER() OVER (PARTITION BY t.XMBH ORDER BY t.XMBH DESC) rn from AREG t left join APPLY t2 on t2.AREGID = t.AREGID and t2.APPTYPE = 0 and T2.STATE = 1) t where t.rn = 1) t3 on t3.XMBH = t1.XMBH
  8. where t1.xmbh in (select XMBH from areg group by XMBH)
  9. </select>
  10. <select id="selectAregByXmbh" resultType="java.util.Map">
  11. select XMBH, JGSTATE from AREG where XMBH = #{xmbh}
  12. </select>
  13. <select id="selectFromAreg" resultType="java.util.Map">
  14. select t1.*,t3.name as BANKNAME,t3.code as BANKCODE
  15. from
  16. AREG t1
  17. LEFT JOIN
  18. ACCOUNT t2 on t1.aregid = t2.aregid
  19. left join
  20. BANK t3 on t2.bankcode = t3.code
  21. </select>
  22. <select id="selectFromAccount" resultType="java.util.Map">
  23. SELECT t1.ACCOUNTID,t4.QYBH,t1.ACCOUNTNAME,t1.ACCOUNTNO,t1.BANKCODE,t2.NAME as BANKNAME,t3.NAME as OPENADDRESS,t4.XMMC,t4.XMBH,
  24. t1.JGSTATE,t1.BALANCE as ACCOUNTBALANCE,t1.BALANCE as BOOKBALANCE ,t1.STATE,
  25. t1.ACCOUNTTYPE as TYPE,t1.FREEZE,to_date(to_char(t5.SPJSSJ,'yyyy-mm-dd hh24:mi:ss'),'yyyy-mm-dd hh24:mi:ss') as KHRQ
  26. FROM ACCOUNT t1
  27. LEFT JOIN BANK t2 on t1.BANKCODE = t2.code
  28. LEFT JOIN BRANCH t3 on t1.BRANCHCODE = t3.code
  29. LEFT JOIN AREG t4 on t1.AREGID = t4.AREGID
  30. LEFT JOIN APPLY t5 on t1.APPID = t5.APPID AND t5.APPTYPE = 0
  31. WHERE ACCOUNTNAME IS NOT NULL
  32. </select>
  33. <!-- 查询账户(托管户/监管户)在途资金 -->
  34. <select id="selectAccountInTransitFund" resultType="java.math.BigDecimal">
  35. select sum(p.money) zhztzj from apply a,payitem p where a.appid =p.appid and p.state ='1' and a.state ='1'
  36. and p.paycode not in (select t.tradenum from trade t where t.tradestate ='1' and tradenum is not null) and p.accountid = #{accountid}
  37. </select>
  38. <!-- 查询工程进度申请信息 -->
  39. <resultMap id="GcjdsqMap" type="com.cool.bang.modules.oracle.domain.po.Gcjdsq">
  40. <result property="id" column="progressid" jdbcType="VARCHAR"/>
  41. <result property="xmbh" column="xmbh" jdbcType="VARCHAR"/>
  42. <result property="qybh" column="qybh" jdbcType="VARCHAR"/>
  43. <result property="jdmc" column="name" jdbcType="VARCHAR"/>
  44. <result property="lzbh" column="lzbh" jdbcType="VARCHAR"/>
  45. <result property="sqjd" column="percent" jdbcType="DECIMAL"/>
  46. <result property="aregid" column="regid" jdbcType="INTEGER"/>
  47. <result property="shzt" column="taskstate" jdbcType="INTEGER"/>
  48. <result property="bz" column="taskopinion" jdbcType="VARCHAR"/>
  49. <result property="sqr" column="sqr" jdbcType="VARCHAR"/>
  50. <result property="sqsj" column="sqsj" jdbcType="TIMESTAMP"/>
  51. <result property="shsj" column="shsj" jdbcType="TIMESTAMP"/>
  52. </resultMap>
  53. <select id="selectPromProgress" resultMap="GcjdsqMap">
  54. select * from progress where state = 1 and taskstate is not null
  55. </select>
  56. </mapper>