DB_SQL.xml 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "https://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <mapper namespace="sample.TcsSiteTradeMapper">
  4. <!-- 하자)현장업체계약 -->
  5. <resultMap type="sample.dto.TcsSiteTradeVo" id="tcsSiteTradeMap">
  6. <id property="cmpnCd" column="CMPN_CD" /><!-- 회사 코드 -->
  7. <id property="siteCd" column="SITE_CD" /><!-- 현장코드 -->
  8. <id property="covendId" column="COVEND_ID" /><!-- 협력업체 ID -->
  9. <id property="contSeq" column="CONT_SEQ" /><!-- 계약순번 -->
  10. <id property="jobGbCd" column="JOB_GB_CD" /><!-- 협력업체유형코드[CS004] -->
  11. <id property="contId" column="CONT_ID" /><!-- 계약 번호 -->
  12. <id property="contModId" column="CONT_MOD_ID" /><!-- 변경 계약번호 -->
  13. <id property="modNo" column="MOD_NO" /><!-- 변경 계약차수 -->
  14. <id property="poDocNo" column="PO_DOC_NO" /><!-- 발주 번호 -->
  15. <id property="contNm" column="CONT_NM" /><!-- 계약 명 -->
  16. <id property="contDt" column="CONT_DT" /><!-- 계약 일자 -->
  17. <id property="covendNm" column="COVEND_NM" /><!-- 업체 명 -->
  18. <id property="covendCorpRegNo" column="COVEND_CORP_REG_NO" /><!-- 업체 사업자번호 -->
  19. <id property="contAmt" column="CONT_AMT" /><!-- 계약 금액 -->
  20. <id property="contSupplyAmt" column="CONT_SUPPLY_AMT" /><!-- 공급 금액 -->
  21. <id property="contTerm" column="CONT_TERM" /><!-- 계약 기간 -->
  22. <id property="contStartDt" column="CONT_START_DT" /><!-- 계약 시작일 -->
  23. <id property="contEndDt" column="CONT_END_DT" /><!-- 계약 만료일 -->
  24. <id property="contGb" column="CONT_GB" /><!-- 계약 구분 -->
  25. <id property="statusCd" column="STATUS_CD" /><!-- 계약 상태 -->
  26. <id property="templateCd" column="TEMPLATE_CD" /><!-- 계약서 코드 -->
  27. <id property="templateNm" column="TEMPLATE_NM" /><!-- 계약서 코드명 -->
  28. <id property="chgContYn" column="CHG_CONT_YN" /><!-- 변경 계약 여부 -->
  29. <id property="curGb" column="CUR_GB" /><!-- 통화 단위 -->
  30. <id property="adjGb" column="ADJ_GB" /><!-- 정산 구분 -->
  31. <id property="rmkCn" column="RMK_CN" /><!-- 비고_내용 -->
  32. <id property="crtSysCd" column="CRT_SYS_CD" /><!-- 생성시스템코드 -->
  33. <id property="wrteDt" column="WRTE_DT" /><!-- 작성 일자 -->
  34. <id property="wrtePr" column="WRTE_PR" /><!-- 작성 자 -->
  35. <id property="mdftDt" column="MDFT_DT" /><!-- 수정 일자 -->
  36. <id property="mdftPr" column="MDFT_PR" /><!-- 수정 자 -->
  37. </resultMap>
  38. <!-- 하자)현장업체계약 - List -->
  39. <select id="selectTcsSiteTradeList" parameterType="sample.dto.TcsSiteTradeVo" resultMap="tcsSiteTradeMap"><![CDATA[
  40. SELECT
  41. A.CMPN_CD AS CMPN_CD ,
  42. A.SITE_CD AS SITE_CD ,
  43. A.COVEND_ID AS COVEND_ID ,
  44. A.CONT_SEQ AS CONT_SEQ ,
  45. A.JOB_GB_CD AS JOB_GB_CD ,
  46. A.CONT_ID AS CONT_ID ,
  47. A.CONT_MOD_ID AS CONT_MOD_ID ,
  48. A.MOD_NO AS MOD_NO ,
  49. A.PO_DOC_NO AS PO_DOC_NO ,
  50. A.CONT_NM AS CONT_NM ,
  51. A.CONT_DT AS CONT_DT ,
  52. A.COVEND_NM AS COVEND_NM ,
  53. A.COVEND_CORP_REG_NO AS COVEND_CORP_REG_NO ,
  54. A.CONT_AMT AS CONT_AMT ,
  55. A.CONT_SUPPLY_AMT AS CONT_SUPPLY_AMT ,
  56. A.CONT_TERM AS CONT_TERM ,
  57. TO_CHAR(CONT_START_DT, 'YYYY-MM-DD') AS CONT_START_DT ,
  58. TO_CHAR(CONT_END_DT, 'YYYY-MM-DD') AS CONT_END_DT ,
  59. A.CONT_GB AS CONT_GB ,
  60. A.STATUS_CD AS STATUS_CD ,
  61. A.TEMPLATE_CD AS TEMPLATE_CD ,
  62. A.TEMPLATE_NM AS TEMPLATE_NM ,
  63. A.CHG_CONT_YN AS CHG_CONT_YN ,
  64. A.CUR_GB AS CUR_GB ,
  65. A.ADJ_GB AS ADJ_GB ,
  66. A.RMK_CN AS RMK_CN ,
  67. A.CRT_SYS_CD AS CRT_SYS_CD ,
  68. TO_CHAR(WRTE_DT, 'YYYY-MM-DD') AS WRTE_DT ,
  69. A.WRTE_PR AS WRTE_PR ,
  70. TO_CHAR(MDFT_DT, 'YYYY-MM-DD') AS MDFT_DT ,
  71. A.MDFT_PR AS MDFT_PR
  72. FROM
  73. TCS_SITE_TRADE A
  74. WHERE
  75. 1=1
  76. ORDER BY
  77. 1
  78. ]]></select>
  79. <!-- 하자)현장업체계약 - View -->
  80. <select id="selectTcsSiteTradeView" parameterType="sample.dto.TcsSiteTradeVo" resultMap="tcsSiteTradeMap"><![CDATA[
  81. SELECT
  82. A.CMPN_CD AS CMPN_CD ,
  83. A.SITE_CD AS SITE_CD ,
  84. A.COVEND_ID AS COVEND_ID ,
  85. A.CONT_SEQ AS CONT_SEQ ,
  86. A.JOB_GB_CD AS JOB_GB_CD ,
  87. A.CONT_ID AS CONT_ID ,
  88. A.CONT_MOD_ID AS CONT_MOD_ID ,
  89. A.MOD_NO AS MOD_NO ,
  90. A.PO_DOC_NO AS PO_DOC_NO ,
  91. A.CONT_NM AS CONT_NM ,
  92. A.CONT_DT AS CONT_DT ,
  93. A.COVEND_NM AS COVEND_NM ,
  94. A.COVEND_CORP_REG_NO AS COVEND_CORP_REG_NO ,
  95. A.CONT_AMT AS CONT_AMT ,
  96. A.CONT_SUPPLY_AMT AS CONT_SUPPLY_AMT ,
  97. A.CONT_TERM AS CONT_TERM ,
  98. TO_CHAR(CONT_START_DT, 'YYYY-MM-DD') AS CONT_START_DT ,
  99. TO_CHAR(CONT_END_DT, 'YYYY-MM-DD') AS CONT_END_DT ,
  100. A.CONT_GB AS CONT_GB ,
  101. A.STATUS_CD AS STATUS_CD ,
  102. A.TEMPLATE_CD AS TEMPLATE_CD ,
  103. A.TEMPLATE_NM AS TEMPLATE_NM ,
  104. A.CHG_CONT_YN AS CHG_CONT_YN ,
  105. A.CUR_GB AS CUR_GB ,
  106. A.ADJ_GB AS ADJ_GB ,
  107. A.RMK_CN AS RMK_CN ,
  108. A.CRT_SYS_CD AS CRT_SYS_CD ,
  109. TO_CHAR(WRTE_DT, 'YYYY-MM-DD') AS WRTE_DT ,
  110. A.WRTE_PR AS WRTE_PR ,
  111. TO_CHAR(MDFT_DT, 'YYYY-MM-DD') AS MDFT_DT ,
  112. A.MDFT_PR AS MDFT_PR
  113. FROM
  114. TCS_SITE_TRADE A
  115. WHERE
  116. CMPN_CD = #{cmpnCd} AND
  117. SITE_CD = #{siteCd} AND
  118. COVEND_ID = #{covendId} AND
  119. CONT_SEQ = #{contSeq}
  120. ]]></select>
  121. <!-- 하자)현장업체계약 - Insert -->
  122. <insert id="insertTcsSiteTrade" parameterType="sample.dto.TcsSiteTradeVo"><![CDATA[
  123. INSERT INTO
  124. TCS_SITE_TRADE
  125. (
  126. A.CMPN_CD AS CMPN_CD ,
  127. A.SITE_CD AS SITE_CD ,
  128. A.COVEND_ID AS COVEND_ID ,
  129. A.CONT_SEQ AS CONT_SEQ ,
  130. A.JOB_GB_CD AS JOB_GB_CD ,
  131. A.CONT_ID AS CONT_ID ,
  132. A.CONT_MOD_ID AS CONT_MOD_ID ,
  133. A.MOD_NO AS MOD_NO ,
  134. A.PO_DOC_NO AS PO_DOC_NO ,
  135. A.CONT_NM AS CONT_NM ,
  136. A.CONT_DT AS CONT_DT ,
  137. A.COVEND_NM AS COVEND_NM ,
  138. A.COVEND_CORP_REG_NO AS COVEND_CORP_REG_NO ,
  139. A.CONT_AMT AS CONT_AMT ,
  140. A.CONT_SUPPLY_AMT AS CONT_SUPPLY_AMT ,
  141. A.CONT_TERM AS CONT_TERM ,
  142. TO_CHAR(CONT_START_DT, 'YYYY-MM-DD') AS CONT_START_DT ,
  143. TO_CHAR(CONT_END_DT, 'YYYY-MM-DD') AS CONT_END_DT ,
  144. A.CONT_GB AS CONT_GB ,
  145. A.STATUS_CD AS STATUS_CD ,
  146. A.TEMPLATE_CD AS TEMPLATE_CD ,
  147. A.TEMPLATE_NM AS TEMPLATE_NM ,
  148. A.CHG_CONT_YN AS CHG_CONT_YN ,
  149. A.CUR_GB AS CUR_GB ,
  150. A.ADJ_GB AS ADJ_GB ,
  151. A.RMK_CN AS RMK_CN ,
  152. A.CRT_SYS_CD AS CRT_SYS_CD ,
  153. TO_CHAR(WRTE_DT, 'YYYY-MM-DD') AS WRTE_DT ,
  154. A.WRTE_PR AS WRTE_PR ,
  155. TO_CHAR(MDFT_DT, 'YYYY-MM-DD') AS MDFT_DT ,
  156. A.MDFT_PR AS MDFT_PR
  157. ) VALUES (
  158. #{cmpnCd} ,
  159. #{siteCd} ,
  160. #{covendId} ,
  161. #{contSeq} ,
  162. #{jobGbCd} ,
  163. #{contId} ,
  164. #{contModId} ,
  165. #{modNo} ,
  166. #{poDocNo} ,
  167. #{contNm} ,
  168. #{contDt} ,
  169. #{covendNm} ,
  170. #{covendCorpRegNo} ,
  171. #{contAmt} ,
  172. #{contSupplyAmt} ,
  173. #{contTerm} ,
  174. SYSDATE ,
  175. SYSDATE ,
  176. #{contGb} ,
  177. #{statusCd} ,
  178. #{templateCd} ,
  179. #{templateNm} ,
  180. #{chgContYn} ,
  181. #{curGb} ,
  182. #{adjGb} ,
  183. #{rmkCn} ,
  184. #{crtSysCd} ,
  185. SYSDATE ,
  186. #{wrtePr} ,
  187. SYSDATE ,
  188. #{mdftPr}
  189. )
  190. ]]></insert>
  191. <!-- 하자)현장업체계약 - Update -->
  192. <update id="updateTcsSiteTrade" parameterType="sample.dto.TcsSiteTradeVo"><![CDATA[
  193. UPDATE
  194. TCS_SITE_TRADE
  195. SET
  196. CMPN_CD = #{cmpnCd} ,
  197. SITE_CD = #{siteCd} ,
  198. COVEND_ID = #{covendId} ,
  199. CONT_SEQ = #{contSeq} ,
  200. JOB_GB_CD = #{jobGbCd} ,
  201. CONT_ID = #{contId} ,
  202. CONT_MOD_ID = #{contModId} ,
  203. MOD_NO = #{modNo} ,
  204. PO_DOC_NO = #{poDocNo} ,
  205. CONT_NM = #{contNm} ,
  206. CONT_DT = #{contDt} ,
  207. COVEND_NM = #{covendNm} ,
  208. COVEND_CORP_REG_NO = #{covendCorpRegNo} ,
  209. CONT_AMT = #{contAmt} ,
  210. CONT_SUPPLY_AMT = #{contSupplyAmt} ,
  211. CONT_TERM = #{contTerm} ,
  212. CONT_START_DT = SYSDATE ,
  213. CONT_END_DT = SYSDATE ,
  214. CONT_GB = #{contGb} ,
  215. STATUS_CD = #{statusCd} ,
  216. TEMPLATE_CD = #{templateCd} ,
  217. TEMPLATE_NM = #{templateNm} ,
  218. CHG_CONT_YN = #{chgContYn} ,
  219. CUR_GB = #{curGb} ,
  220. ADJ_GB = #{adjGb} ,
  221. RMK_CN = #{rmkCn} ,
  222. CRT_SYS_CD = #{crtSysCd} ,
  223. WRTE_DT = SYSDATE ,
  224. WRTE_PR = #{wrtePr} ,
  225. MDFT_DT = SYSDATE ,
  226. MDFT_PR = #{mdftPr}
  227. WHERE
  228. CMPN_CD = #{cmpnCd} AND
  229. SITE_CD = #{siteCd} AND
  230. COVEND_ID = #{covendId} AND
  231. CONT_SEQ = #{contSeq}
  232. ]]></update>
  233. <!-- 하자)현장업체계약 - Delete -->
  234. <delete id="deleteTcsSiteTrade" parameterType="sample.dto.TcsSiteTradeVo"><![CDATA[
  235. DELETE
  236. TCS_SITE_TRADE
  237. WHERE
  238. CMPN_CD = #{cmpnCd} AND
  239. SITE_CD = #{siteCd} AND
  240. COVEND_ID = #{covendId} AND
  241. CONT_SEQ = #{contSeq}
  242. ]]></delete>
  243. </mapper>