DB_SQL.xml 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  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.TcsSiteDhsMapper">
  4. <!-- 하자) 현장 동호수 -->
  5. <resultMap type="sample.dto.TcsSiteDhsVo" id="tcsSiteDhsMap">
  6. <id property="cmpnCd" column="CMPN_CD" /><!-- 회사 코드 -->
  7. <id property="siteCd" column="SITE_CD" /><!-- 현장코드 -->
  8. <id property="dong" column="DONG" /><!-- 동 -->
  9. <id property="hsno" column="HSNO" /><!-- 호수 -->
  10. <id property="cntprOcphNm" column="CNTPR_OCPH_NM" /><!-- 계약 입주 자 -->
  11. <id property="cpNo" column="CP_NO" /><!-- 핸드폰 번호 -->
  12. <id property="wrteDt" column="WRTE_DT" /><!-- 작성 일자 -->
  13. <id property="wrtePr" column="WRTE_PR" /><!-- 작성 자 -->
  14. <id property="mdftDt" column="MDFT_DT" /><!-- 수정 일자 -->
  15. <id property="mdftPr" column="MDFT_PR" /><!-- 수정 자 -->
  16. </resultMap>
  17. <!-- 하자) 현장 동호수 - List -->
  18. <select id="selectTcsSiteDhsList" parameterType="sample.dto.TcsSiteDhsVo" resultMap="tcsSiteDhsMap"><![CDATA[
  19. SELECT
  20. A.CMPN_CD AS CMPN_CD ,
  21. A.SITE_CD AS SITE_CD ,
  22. A.DONG AS DONG ,
  23. A.HSNO AS HSNO ,
  24. A.CNTPR_OCPH_NM AS CNTPR_OCPH_NM ,
  25. A.CP_NO AS CP_NO ,
  26. TO_CHAR(WRTE_DT, 'YYYY-MM-DD') AS WRTE_DT ,
  27. A.WRTE_PR AS WRTE_PR ,
  28. TO_CHAR(MDFT_DT, 'YYYY-MM-DD') AS MDFT_DT ,
  29. A.MDFT_PR AS MDFT_PR
  30. FROM
  31. TCS_SITE_DHS A
  32. WHERE
  33. 1=1
  34. ORDER BY
  35. 1
  36. ]]></select>
  37. <!-- 하자) 현장 동호수 - View -->
  38. <select id="selectTcsSiteDhsView" parameterType="sample.dto.TcsSiteDhsVo" resultMap="tcsSiteDhsMap"><![CDATA[
  39. SELECT
  40. A.CMPN_CD AS CMPN_CD ,
  41. A.SITE_CD AS SITE_CD ,
  42. A.DONG AS DONG ,
  43. A.HSNO AS HSNO ,
  44. A.CNTPR_OCPH_NM AS CNTPR_OCPH_NM ,
  45. A.CP_NO AS CP_NO ,
  46. TO_CHAR(WRTE_DT, 'YYYY-MM-DD') AS WRTE_DT ,
  47. A.WRTE_PR AS WRTE_PR ,
  48. TO_CHAR(MDFT_DT, 'YYYY-MM-DD') AS MDFT_DT ,
  49. A.MDFT_PR AS MDFT_PR
  50. FROM
  51. TCS_SITE_DHS A
  52. WHERE
  53. CMPN_CD = #{cmpnCd} AND
  54. SITE_CD = #{siteCd} AND
  55. DONG = #{dong} AND
  56. HSNO = #{hsno}
  57. ]]></select>
  58. <!-- 하자) 현장 동호수 - Insert -->
  59. <insert id="insertTcsSiteDhs" parameterType="sample.dto.TcsSiteDhsVo"><![CDATA[
  60. INSERT INTO
  61. TCS_SITE_DHS
  62. (
  63. A.CMPN_CD AS CMPN_CD ,
  64. A.SITE_CD AS SITE_CD ,
  65. A.DONG AS DONG ,
  66. A.HSNO AS HSNO ,
  67. A.CNTPR_OCPH_NM AS CNTPR_OCPH_NM ,
  68. A.CP_NO AS CP_NO ,
  69. TO_CHAR(WRTE_DT, 'YYYY-MM-DD') AS WRTE_DT ,
  70. A.WRTE_PR AS WRTE_PR ,
  71. TO_CHAR(MDFT_DT, 'YYYY-MM-DD') AS MDFT_DT ,
  72. A.MDFT_PR AS MDFT_PR
  73. ) VALUES (
  74. #{cmpnCd} ,
  75. #{siteCd} ,
  76. #{dong} ,
  77. #{hsno} ,
  78. #{cntprOcphNm} ,
  79. #{cpNo} ,
  80. SYSDATE ,
  81. #{wrtePr} ,
  82. SYSDATE ,
  83. #{mdftPr}
  84. )
  85. ]]></insert>
  86. <!-- 하자) 현장 동호수 - Update -->
  87. <update id="updateTcsSiteDhs" parameterType="sample.dto.TcsSiteDhsVo"><![CDATA[
  88. UPDATE
  89. TCS_SITE_DHS
  90. SET
  91. CMPN_CD = #{cmpnCd} ,
  92. SITE_CD = #{siteCd} ,
  93. DONG = #{dong} ,
  94. HSNO = #{hsno} ,
  95. CNTPR_OCPH_NM = #{cntprOcphNm} ,
  96. CP_NO = #{cpNo} ,
  97. WRTE_DT = SYSDATE ,
  98. WRTE_PR = #{wrtePr} ,
  99. MDFT_DT = SYSDATE ,
  100. MDFT_PR = #{mdftPr}
  101. WHERE
  102. CMPN_CD = #{cmpnCd} AND
  103. SITE_CD = #{siteCd} AND
  104. DONG = #{dong} AND
  105. HSNO = #{hsno}
  106. ]]></update>
  107. <!-- 하자) 현장 동호수 - Delete -->
  108. <delete id="deleteTcsSiteDhs" parameterType="sample.dto.TcsSiteDhsVo"><![CDATA[
  109. DELETE
  110. TCS_SITE_DHS
  111. WHERE
  112. CMPN_CD = #{cmpnCd} AND
  113. SITE_CD = #{siteCd} AND
  114. DONG = #{dong} AND
  115. HSNO = #{hsno}
  116. ]]></delete>
  117. </mapper>