AttRlrwBaseDao.xml 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  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="cn.com.goldenwater.dcproj.dao.AttRlrwBaseDao">
  4. <resultMap type="cn.com.goldenwater.dcproj.model.AttRlrwBase" id="attRlrwBaseResultMap">
  5. <result property="landCode" column="LAND_CODE"/>
  6. <result property="landName" column="LAND_NAME"/>
  7. <result property="landArea" column="LAND_AREA"/>
  8. <result property="adCode" column="AD_CODE"/>
  9. <result property="adName" column="AD_NAME"/>
  10. <result property="contact" column="CONTACT"/>
  11. <result property="contactTel" column="CONTACT_TEL"/>
  12. <result property="centerX" column="CENTER_X"/>
  13. <result property="centerY" column="CENTER_Y"/>
  14. <result property="gdX" column="GD_X"/>
  15. <result property="gdY" column="GD_Y"/>
  16. <result property="persId" column="PERS_ID"/>
  17. <result property="intm" column="INTM"/>
  18. <result property="uptm" column="UPTM"/>
  19. <result property="dataStat" column="DATA_STAT"/>
  20. </resultMap>
  21. <sql id="table_columns">
  22. LAND_CODE,
  23. LAND_NAME,
  24. LAND_AREA,
  25. AD_CODE,
  26. AD_NAME,
  27. CONTACT,
  28. CONTACT_TEL,
  29. CENTER_X,
  30. CENTER_Y,
  31. GD_X,
  32. GD_Y,
  33. PERS_ID,
  34. INTM,
  35. UPTM,
  36. DATA_STAT
  37. </sql>
  38. <sql id="entity_properties">
  39. #{landCode},
  40. #{landName},
  41. #{landArea},
  42. #{adCode},
  43. #{adName},
  44. #{contact},
  45. #{contactTel},
  46. #{centerX},
  47. #{centerY},
  48. #{gdX},
  49. #{gdY},
  50. #{persId},
  51. #{intm},
  52. #{uptm},
  53. #{dataStat}
  54. </sql>
  55. <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
  56. <sql id="page_where">
  57. <trim prefix="where" prefixOverrides="and | or ">
  58. <if test="landName != null and landName != ''">and LAND_NAME = #{landName}</if>
  59. <if test="landArea != null and landArea != ''">and LAND_AREA = #{landArea}</if>
  60. <if test="adCode != null and adCode != ''">and AD_CODE = #{adCode}</if>
  61. <if test="adName != null and adName != ''">and AD_NAME = #{adName}</if>
  62. <if test="contact != null and contact != ''">and CONTACT = #{contact}</if>
  63. <if test="contactTel != null and contactTel != ''">and CONTACT_TEL = #{contactTel}</if>
  64. <if test="centerX != null and centerX != ''">and CENTER_X = #{centerX}</if>
  65. <if test="centerY != null and centerY != ''">and CENTER_Y = #{centerY}</if>
  66. <if test="gdX != null and gdX != ''">and GD_X = #{gdX}</if>
  67. <if test="gdY != null and gdY != ''">and GD_Y = #{gdY}</if>
  68. <if test="persId != null and persId != ''">and PERS_ID = #{persId}</if>
  69. <if test="intm != null">and INTM = #{intm}</if>
  70. <if test="uptm != null">and UPTM = #{uptm}</if>
  71. <if test="dataStat != null and dataStat != ''">and DATA_STAT = #{dataStat}</if>
  72. </trim>
  73. </sql>
  74. <select id="get" resultMap="attRlrwBaseResultMap" parameterType="String" >
  75. select <include refid="table_columns" /> from ATT_RLRW_BASE where LAND_CODE = #{id}
  76. </select>
  77. <select id="getBy" resultMap="attRlrwBaseResultMap">
  78. select <include refid="table_columns" /> from ATT_RLRW_BASE <include refid="page_where" />
  79. </select>
  80. <select id="findAll" resultMap="attRlrwBaseResultMap">
  81. select <include refid="table_columns" /> from ATT_RLRW_BASE
  82. </select>
  83. <select id="findList" resultMap="attRlrwBaseResultMap">
  84. select <include refid="table_columns" /> from ATT_RLRW_BASE <include refid="page_where" />
  85. </select>
  86. <select id="selectCount" resultType="int" >
  87. select count(LAND_CODE) from ATT_RLRW_BASE <include refid="page_where" />
  88. </select>
  89. <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.AttRlrwBase">
  90. insert into ATT_RLRW_BASE( <include refid="table_columns" /> )
  91. values ( <include refid="entity_properties" /> )
  92. </insert>
  93. <delete id="delete" parameterType="java.lang.String">
  94. update ATT_RLRW_BASE set DATA_STAT='9' where LAND_CODE = #{id}
  95. </delete>
  96. <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.AttRlrwBase">
  97. delete from ATT_RLRW_BASE <include refid="page_where" />
  98. </delete>
  99. <update id="deleteInFlag" parameterType="java.lang.String">
  100. update ATT_RLRW_BASE set flag_valid = 0 where LAND_CODE = #{id}
  101. </update>
  102. <update id="update" parameterType="cn.com.goldenwater.dcproj.model.AttRlrwBase">
  103. update ATT_RLRW_BASE
  104. <trim prefix="set" suffixOverrides=",">
  105. <if test="landName != null and landName != ''">LAND_NAME = #{landName},</if>
  106. <if test="landArea != null and landArea != ''">LAND_AREA = #{landArea},</if>
  107. <if test="adCode != null and adCode != ''">AD_CODE = #{adCode},</if>
  108. <if test="adName != null and adName != ''">AD_NAME = #{adName},</if>
  109. <if test="contact != null and contact != ''">CONTACT = #{contact},</if>
  110. <if test="contactTel != null and contactTel != ''">CONTACT_TEL = #{contactTel},</if>
  111. <if test="centerX != null and centerX != ''">CENTER_X = #{centerX},</if>
  112. <if test="centerY != null and centerY != ''">CENTER_Y = #{centerY},</if>
  113. <if test="gdX != null and gdX != ''">GD_X = #{gdX},</if>
  114. <if test="gdY != null and gdY != ''">GD_Y = #{gdY},</if>
  115. <if test="persId != null and persId != ''">PERS_ID = #{persId},</if>
  116. <if test="intm != null">INTM = #{intm},</if>
  117. <if test="uptm != null">UPTM = #{uptm},</if>
  118. <if test="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
  119. </trim>
  120. <where>LAND_CODE = #{landCode}</where>
  121. </update>
  122. <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.AttRlrwBase">
  123. update ATT_RLRW_BASE
  124. <trim prefix="set" suffixOverrides=",">
  125. <if test="landName != null and landName != ''">LAND_NAME = #{landName},</if>
  126. <if test="landArea != null and landArea != ''">LAND_AREA = #{landArea},</if>
  127. <if test="adCode != null and adCode != ''">AD_CODE = #{adCode},</if>
  128. <if test="adName != null and adName != ''">AD_NAME = #{adName},</if>
  129. <if test="contact != null and contact != ''">CONTACT = #{contact},</if>
  130. <if test="contactTel != null and contactTel != ''">CONTACT_TEL = #{contactTel},</if>
  131. <if test="centerX != null and centerX != ''">CENTER_X = #{centerX},</if>
  132. <if test="centerY != null and centerY != ''">CENTER_Y = #{centerY},</if>
  133. <if test="gdX != null and gdX != ''">GD_X = #{gdX},</if>
  134. <if test="gdY != null and gdY != ''">GD_Y = #{gdY},</if>
  135. <if test="persId != null and persId != ''">PERS_ID = #{persId},</if>
  136. <if test="intm != null">INTM = #{intm},</if>
  137. <if test="uptm != null">UPTM = #{uptm},</if>
  138. <if test="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
  139. </trim>
  140. <include refid="page_where" />
  141. </update>
  142. <!-- 其他自定义SQL -->
  143. <select id="getObjId" resultMap="attRlrwBaseResultMap">
  144. SELECT
  145. <include refid="table_columns" />
  146. FROM ATT_RLRW_BASE
  147. WHERE LAND_CODE = (SELECT CODE FROM BIS_INSP_ALL_OBJ WHERE OBJ_ID = #{objId})
  148. </select>
  149. </mapper>