期初数据后台
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

CustCtrlMapper.xml 6.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  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.example.backend.mapper.contract.CustCtrlMapper">
  4. <select id="selectOurNameByFoursname" resultType="com.example.backend.entity.common.CustCtrl">
  5. select a.id,a.fno,a.cpal,a.cpny,a.addr,a.namee,a.addrc,a.signLoc ,
  6. case when nvl(b.bankNm,'')='' then '无' else nvl(b.bankNm,'') end as ourBankNm,
  7. case when nvl(b.bankAcct,'')='' then '无' else nvl(b.bankAcct,'') end as ourBankAcct
  8. from SGGMIIP.addrctrl a
  9. LEFT JOIN (
  10. SELECT stopBank,rid , bankNm , bankAcct , ROW_NUMBER() OVER (PARTITION BY rid ORDER BY id) as row_num
  11. FROM SGGMIIP.custbank WHERE NVL(del_flag, 0) != 1 and stopBank='否'
  12. ) b ON a.id = b.rid AND b.row_num = 1
  13. where ifnull(a.del_flag, 0) != 1
  14. and NVL(a.placed, '0') = '2'
  15. and a.cpny = #{foursname}
  16. order by a.fno desc
  17. </select>
  18. <select id="selectLPortByLportName" resultType="com.example.backend.entity.common.CustCtrl">
  19. select fno,portName,portCd,portNm,country,countryName
  20. from SGGMIIP.portCtrl
  21. where nvl(del_flag, 0) !=1
  22. and isnull(country,'')!=''
  23. and portName = #{lPort}
  24. order by fno
  25. </select>
  26. <select id="selectByAgentNo" resultType="com.example.backend.entity.common.CustCtrl">
  27. select a.fno,a.fdate,a.foursname,a.ctName
  28. from SGGMIIP.ImpAgencyAgt a
  29. where ifnull(a.del_flag, 0) != 1
  30. and ifnull(a.placed,'')='2'
  31. and a.fno = #{agentNo}
  32. order by a.fdate desc
  33. </select>
  34. <select id="selectByAgentNoSo" resultType="com.example.backend.entity.common.CustCtrl">
  35. select a.fno,a.fdate,a.foursname,a.ctName
  36. from SGGMIIP.ExpAgencyAgt a
  37. where ifnull(a.del_flag, 0) != 1
  38. and ifnull(a.placed,'')='2'
  39. and a.fno =#{agentNoSo}
  40. order by a.fdate desc
  41. </select>
  42. <select id="selectCommContrNo" resultType="com.example.backend.entity.common.CustCtrl">
  43. select a.fno
  44. from SGGMIIP.otherTContract a
  45. where ifnull(a.del_flag, 0) != 1
  46. and ifnull(a.contrType, '') = '佣金合同'
  47. and a.fno =#{commContrNo}
  48. and not exists (
  49. select 1
  50. from SGGMIIP.t_ctc_sales_Contract B
  51. where B.commContrNo = A.fno
  52. )
  53. order by a.fdate desc
  54. </select>
  55. <select id="selectByItemno" resultType="com.example.backend.entity.common.CustCtrl">
  56. select b.type_name2,
  57. a.itemno,
  58. a.sdesc,
  59. a.edesc,
  60. a.ut,
  61. a.hsCode,
  62. a.hsNameCn,
  63. a.hsNameEn,
  64. a.inTaxRate,
  65. a.brand
  66. from SGGMIIP.invitem a
  67. left join (select fno, type_name type_name2
  68. from SGGMIIP.product_category
  69. where nvl(del_flag, 0) != 1
  70. and level = 0
  71. and parent_id = 0) b on SUBSTR(a.itemno, 1, 2) = b.fno
  72. where ifnull(a.del_flag, 0) != 1
  73. and b.type_name2 = #{bizProductType}
  74. and a.itemno = #{itemno}
  75. </select>
  76. <select id="selectByCurcyPo" resultType="com.example.backend.entity.common.CustCtrl">
  77. select a.id
  78. , a.fname
  79. , a.fname1
  80. , (select rate
  81. from SGGMIIP.curcydtl
  82. where a.id = rid
  83. and targetcode = 'CNY'
  84. and del_flag != 1) as rate
  85. , (select rate
  86. from SGGMIIP.curcydtl
  87. where a.id = rid
  88. and targetcode = 'USD'
  89. and del_flag != 1) as rateUsd
  90. from SGGMIIP.curcyctrl A
  91. where ifnull(a.del_flag, 0) != 1
  92. and ifnull(a.placed, '') = '2'
  93. and a.fname = #{curcyPo}
  94. group by a.id, a.fname, a.fname1
  95. </select>
  96. <select id="selectByResourceNo" resultType="com.example.backend.entity.common.CustCtrl">
  97. select a.fno
  98. from SGGMIIP.resourcectrl a
  99. where ifnull(a.del_flag, 0) != 1
  100. and ifnull(a.placed, '')='2'
  101. and typename=#{bizProductType}
  102. and a.fno =#{resourceNo}
  103. order by a.fdate desc,a.fno
  104. </select>
  105. <select id="selectByFtype3" resultType="com.example.backend.entity.common.CustCtrl">
  106. select steelProductSpecNo,steelProductSpecularity,fnum4
  107. from SGGMIIP.steelProductSpec
  108. where ifnull(del_flag, 0) != 1
  109. and steelProductSpecularity =#{ftype3}
  110. </select>
  111. <select id="selectByOurBankNm" resultType="com.example.backend.entity.common.CustCtrl">
  112. select a.bankNm,a.bankAcct
  113. from SGGMIIP.custbank a
  114. left join SGGMIIP.addrctrl b on a.rid = b.id
  115. where ifnull(a.del_flag, 0) != 1
  116. and a.stopBank='否'
  117. and a.bankNm =#{ourBankNm}
  118. </select>
  119. <select id="selectByOurBankAcct" resultType="com.example.backend.entity.common.CustCtrl">
  120. select a.bankNm,a.bankAcct
  121. from SGGMIIP.custbank a
  122. left join SGGMIIP.addrctrl b on a.rid = b.id
  123. where ifnull(a.del_flag, 0) != 1
  124. and a.stopBank='否'
  125. and a.bankNm =#{ourBankAcct}
  126. </select>
  127. <select id="selectByPersonDeptNm" resultType="com.example.backend.entity.common.CustCtrl">
  128. SELECT
  129. t.fno,
  130. t.cpny,
  131. t.deptname as deptName,
  132. t.deptcode as deptCode
  133. FROM (
  134. SELECT DISTINCT
  135. c.fno,
  136. c.cpny,
  137. a.deptname,
  138. a.deptcode
  139. FROM SGGMIIP.View_Dept_Code a
  140. LEFT JOIN SGGMIIP.View_User_Code b ON a.deptid = b.dept_id
  141. LEFT JOIN SGGMIIP.addrctrl c ON a.fourscode = c.hrDeptCode
  142. ) t
  143. where t.deptname =#{personDeptNm}
  144. </select>
  145. <select id="selectByFeeNm" resultType="com.example.backend.entity.common.CustCtrl">
  146. select cateCode,cateName,feeCd,feeNm,allocationCategory
  147. from SGGMIIP.fytypedtl
  148. where ifnull(del_flag, 0) != 1
  149. and feeNm = #{feeNm}
  150. order by cateCode,feeCd
  151. </select>
  152. </mapper>