AttJspwiuBaseDao.xml 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  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.AttJspwiuBaseDao">
  4. <resultMap type="cn.com.goldenwater.dcproj.model.AttJspwiuBase" id="attJspwiuBaseResultMap">
  5. <result property="id" column="ID"/>
  6. <result property="name" column="NAME"/>
  7. <result property="adCode" column="AD_CODE"/>
  8. <result property="adName" column="AD_NAME"/>
  9. <result property="sctcd" column="SCTCD"/>
  10. <result property="depType" column="DEP_TYPE"/>
  11. <result property="tmpType" column="TMP_TYPE"/>
  12. <result property="regAddr" column="REG_ADDR"/>
  13. <result property="busAddr" column="BUS_ADDR"/>
  14. <result property="conPers" column="CON_PERS"/>
  15. <result property="conPersTel" column="CON_PERS_TEL"/>
  16. <result property="keyPers" column="KEY_PERS"/>
  17. <result property="centerX" column="CENTER_X"/>
  18. <result property="centerY" column="CENTER_Y"/>
  19. <result property="gdX" column="GD_X"/>
  20. <result property="gdY" column="GD_Y"/>
  21. <result property="persId" column="PERS_ID"/>
  22. <result property="intm" column="INTM"/>
  23. <result property="uptm" column="UPTM"/>
  24. <result property="note" column="NOTE"/>
  25. <result property="dataStat" column="DATA_STAT"/>
  26. </resultMap>
  27. <sql id="table_columns">
  28. ID,
  29. NAME,
  30. AD_CODE,
  31. AD_NAME,
  32. SCTCD,
  33. DEP_TYPE,
  34. TMP_TYPE,
  35. REG_ADDR,
  36. BUS_ADDR,
  37. CON_PERS,
  38. CON_PERS_TEL,
  39. KEY_PERS,
  40. CENTER_X,
  41. CENTER_Y,
  42. GD_X,
  43. GD_Y,
  44. PERS_ID,
  45. INTM,
  46. UPTM,
  47. NOTE,
  48. DATA_STAT
  49. </sql>
  50. <sql id="entity_properties">
  51. #{id},
  52. #{name},
  53. #{adCode},
  54. #{adName},
  55. #{sctcd},
  56. #{depType},
  57. #{tmpType},
  58. #{regAddr},
  59. #{busAddr},
  60. #{conPers},
  61. #{conPersTel},
  62. #{keyPers},
  63. #{centerX},
  64. #{centerY},
  65. #{gdX},
  66. #{gdY},
  67. #{persId},
  68. #{intm},
  69. #{uptm},
  70. #{note},
  71. #{dataStat}
  72. </sql>
  73. <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
  74. <sql id="page_where">
  75. <trim prefix="where" prefixOverrides="and | or ">
  76. <if test="name != null and name != ''">and NAME = #{name}</if>
  77. <if test="adCode != null and adCode != ''">and AD_CODE like '${adCode}%'</if>
  78. <if test="adName != null and adName != ''">and AD_NAME = #{adName}</if>
  79. <if test="sctcd != null and sctcd != ''">and SCTCD = #{sctcd}</if>
  80. <if test="depType != null and depType != ''">and DEP_TYPE = #{depType}</if>
  81. <if test="tmpType != null and tmpType != ''">and TMP_TYPE = #{tmpType}</if>
  82. <if test="regAddr != null and regAddr != ''">and REG_ADDR = #{regAddr}</if>
  83. <if test="busAddr != null and busAddr != ''">and BUS_ADDR = #{busAddr}</if>
  84. <if test="conPers != null and conPers != ''">and CON_PERS = #{conPers}</if>
  85. <if test="conPersTel != null and conPersTel != ''">and CON_PERS_TEL = #{conPersTel}</if>
  86. <if test="keyPers != null and keyPers != ''">and KEY_PERS = #{keyPers}</if>
  87. <if test="centerX != null and centerX != ''">and CENTER_X = #{centerX}</if>
  88. <if test="centerY != null and centerY != ''">and CENTER_Y = #{centerY}</if>
  89. <if test="gdX != null and gdX != ''">and GD_X = #{gdX}</if>
  90. <if test="gdY != null and gdY != ''">and GD_Y = #{gdY}</if>
  91. <if test="persId != null and persId != ''">and PERS_ID = #{persId}</if>
  92. <if test="intm != null">and INTM = #{intm}</if>
  93. <if test="uptm != null">and UPTM = #{uptm}</if>
  94. <if test="note != null and note != ''">and NOTE = #{note}</if>
  95. <if test="dataStat != null and dataStat != ''">and DATA_STAT = #{dataStat}</if>
  96. </trim>
  97. </sql>
  98. <select id="get" resultMap="attJspwiuBaseResultMap" parameterType="String" >
  99. select <include refid="table_columns" /> from ATT_JSPWIU_BASE where ID = #{id}
  100. </select>
  101. <select id="getBy" resultMap="attJspwiuBaseResultMap">
  102. select <include refid="table_columns" /> from ATT_JSPWIU_BASE <include refid="page_where" />
  103. </select>
  104. <select id="findAll" resultMap="attJspwiuBaseResultMap">
  105. select <include refid="table_columns" /> from ATT_JSPWIU_BASE
  106. </select>
  107. <select id="findList" resultMap="attJspwiuBaseResultMap">
  108. select <include refid="table_columns" /> from ATT_JSPWIU_BASE <include refid="page_where" />
  109. </select>
  110. <select id="selectCount" resultType="int" >
  111. select count(ID) from ATT_JSPWIU_BASE <include refid="page_where" />
  112. </select>
  113. <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.AttJspwiuBase">
  114. insert into ATT_JSPWIU_BASE( <include refid="table_columns" /> )
  115. values ( <include refid="entity_properties" /> )
  116. </insert>
  117. <delete id="delete" parameterType="java.lang.String">
  118. update ATT_JSPWIU_BASE set DATA_STAT='9' where ID = #{id}
  119. </delete>
  120. <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.AttJspwiuBase">
  121. delete from ATT_JSPWIU_BASE
  122. <include refid="page_where" />
  123. </delete>
  124. <update id="deleteInFlag" parameterType="java.lang.String">
  125. update ATT_JSPWIU_BASE set flag_valid = 0 where ID = #{id}
  126. </update>
  127. <update id="update" parameterType="cn.com.goldenwater.dcproj.model.AttJspwiuBase">
  128. update ATT_JSPWIU_BASE
  129. <trim prefix="set" suffixOverrides=",">
  130. <if test="name != null and name != ''">NAME = #{name},</if>
  131. <if test="adCode != null and adCode != ''">AD_CODE = #{adCode},</if>
  132. <if test="adName != null and adName != ''">AD_NAME = #{adName},</if>
  133. <if test="sctcd != null and sctcd != ''">SCTCD = #{sctcd},</if>
  134. <if test="depType != null and depType != ''">DEP_TYPE = #{depType},</if>
  135. <if test="tmpType != null and tmpType != ''">TMP_TYPE = #{tmpType},</if>
  136. <if test="regAddr != null and regAddr != ''">REG_ADDR = #{regAddr},</if>
  137. <if test="busAddr != null and busAddr != ''">BUS_ADDR = #{busAddr},</if>
  138. <if test="conPers != null and conPers != ''">CON_PERS = #{conPers},</if>
  139. <if test="conPersTel != null and conPersTel != ''">CON_PERS_TEL = #{conPersTel},</if>
  140. <if test="keyPers != null and keyPers != ''">KEY_PERS = #{keyPers},</if>
  141. <if test="centerX != null and centerX != ''">CENTER_X = #{centerX},</if>
  142. <if test="centerY != null and centerY != ''">CENTER_Y = #{centerY},</if>
  143. <if test="gdX != null and gdX != ''">GD_X = #{gdX},</if>
  144. <if test="gdY != null and gdY != ''">GD_Y = #{gdY},</if>
  145. <if test="persId != null and persId != ''">PERS_ID = #{persId},</if>
  146. <if test="intm != null">INTM = #{intm},</if>
  147. <if test="uptm != null">UPTM = #{uptm},</if>
  148. <if test="note != null and note != ''">NOTE = #{note},</if>
  149. <if test="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
  150. </trim>
  151. <where>ID = #{id}</where>
  152. </update>
  153. <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.AttJspwiuBase">
  154. update ATT_JSPWIU_BASE
  155. <trim prefix="set" suffixOverrides=",">
  156. <if test="name != null and name != ''">NAME = #{name},</if>
  157. <if test="adCode != null and adCode != ''">AD_CODE = #{adCode},</if>
  158. <if test="adName != null and adName != ''">AD_NAME = #{adName},</if>
  159. <if test="sctcd != null and sctcd != ''">SCTCD = #{sctcd},</if>
  160. <if test="depType != null and depType != ''">DEP_TYPE = #{depType},</if>
  161. <if test="tmpType != null and tmpType != ''">TMP_TYPE = #{tmpType},</if>
  162. <if test="regAddr != null and regAddr != ''">REG_ADDR = #{regAddr},</if>
  163. <if test="busAddr != null and busAddr != ''">BUS_ADDR = #{busAddr},</if>
  164. <if test="conPers != null and conPers != ''">CON_PERS = #{conPers},</if>
  165. <if test="conPersTel != null and conPersTel != ''">CON_PERS_TEL = #{conPersTel},</if>
  166. <if test="keyPers != null and keyPers != ''">KEY_PERS = #{keyPers},</if>
  167. <if test="centerX != null and centerX != ''">CENTER_X = #{centerX},</if>
  168. <if test="centerY != null and centerY != ''">CENTER_Y = #{centerY},</if>
  169. <if test="gdX != null and gdX != ''">GD_X = #{gdX},</if>
  170. <if test="gdY != null and gdY != ''">GD_Y = #{gdY},</if>
  171. <if test="persId != null and persId != ''">PERS_ID = #{persId},</if>
  172. <if test="intm != null">INTM = #{intm},</if>
  173. <if test="uptm != null">UPTM = #{uptm},</if>
  174. <if test="note != null and note != ''">NOTE = #{note},</if>
  175. <if test="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
  176. </trim>
  177. <include refid="page_where" />
  178. </update>
  179. <!-- 其他自定义SQL -->
  180. <select id="getObjId" resultMap="attJspwiuBaseResultMap" parameterType="String" >
  181. select <include refid="table_columns" /> from ATT_JSPWIU_BASE where ID = (SELECT CODE FROM BIS_INSP_ALL_OBJ WHERE OBJ_ID = #{objId} )
  182. </select>
  183. </mapper>