AttFjaccpBaseDao.xml 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  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.AttFjaccpBaseDao">
  4. <resultMap type="cn.com.goldenwater.dcproj.model.AttFjaccpBase" id="attFjaccpBaseResultMap">
  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="busAddr" column="BUS_ADDR"/>
  10. <result property="conPers" column="CON_PERS"/>
  11. <result property="conPersTel" column="CON_PERS_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="note" column="NOTE"/>
  20. <result property="dataStat" column="DATA_STAT"/>
  21. <result property="isCnfm" column="IS_CNFM"/>
  22. </resultMap>
  23. <sql id="table_columns">
  24. ID,
  25. NAME,
  26. AD_CODE,
  27. AD_NAME,
  28. BUS_ADDR,
  29. CON_PERS,
  30. CON_PERS_TEL,
  31. CENTER_X,
  32. CENTER_Y,
  33. GD_X,
  34. GD_Y,
  35. PERS_ID,
  36. INTM,
  37. UPTM,
  38. NOTE,
  39. DATA_STAT,
  40. IS_CNFM
  41. </sql>
  42. <sql id="entity_properties">
  43. #{id},
  44. #{name},
  45. #{adCode},
  46. #{adName},
  47. #{busAddr},
  48. #{conPers},
  49. #{conPersTel},
  50. #{centerX},
  51. #{centerY},
  52. #{gdX},
  53. #{gdY},
  54. #{persId},
  55. #{intm},
  56. #{uptm},
  57. #{note},
  58. #{dataStat},
  59. #{isCnfm}
  60. </sql>
  61. <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
  62. <sql id="page_where">
  63. <trim prefix="where" prefixOverrides="and | or ">
  64. <if test="name != null and name != ''">and NAME = #{name}</if>
  65. <if test="adCode != null and adCode != ''">and AD_CODE = #{adCode}</if>
  66. <if test="adName != null and adName != ''">and AD_NAME = #{adName}</if>
  67. <if test="busAddr != null and busAddr != ''">and BUS_ADDR = #{busAddr}</if>
  68. <if test="conPers != null and conPers != ''">and CON_PERS = #{conPers}</if>
  69. <if test="conPersTel != null and conPersTel != ''">and CON_PERS_TEL = #{conPersTel}</if>
  70. <if test="centerX != null and centerX != ''">and CENTER_X = #{centerX}</if>
  71. <if test="centerY != null and centerY != ''">and CENTER_Y = #{centerY}</if>
  72. <if test="gdX != null and gdX != ''">and GD_X = #{gdX}</if>
  73. <if test="gdY != null and gdY != ''">and GD_Y = #{gdY}</if>
  74. <if test="persId != null and persId != ''">and PERS_ID = #{persId}</if>
  75. <if test="intm != null">and INTM = #{intm}</if>
  76. <if test="uptm != null">and UPTM = #{uptm}</if>
  77. <if test="note != null and note != ''">and NOTE = #{note}</if>
  78. <if test="dataStat != null and dataStat != ''">and DATA_STAT = #{dataStat}</if>
  79. <if test="isCnfm != null and isCnfm != ''">and IS_CNFM = #{isCnfm}</if>
  80. </trim>
  81. </sql>
  82. <select id="get" resultMap="attFjaccpBaseResultMap" parameterType="String" >
  83. select <include refid="table_columns" /> from ATT_FJACCP_BASE where ID = #{id}
  84. </select>
  85. <select id="getBy" resultMap="attFjaccpBaseResultMap">
  86. select <include refid="table_columns" /> from ATT_FJACCP_BASE <include refid="page_where" />
  87. </select>
  88. <select id="findAll" resultMap="attFjaccpBaseResultMap">
  89. select <include refid="table_columns" /> from ATT_FJACCP_BASE
  90. </select>
  91. <select id="findList" resultMap="attFjaccpBaseResultMap">
  92. select <include refid="table_columns" /> from ATT_FJACCP_BASE <include refid="page_where" />
  93. </select>
  94. <select id="selectCount" resultType="int" >
  95. select count(ID) from ATT_FJACCP_BASE <include refid="page_where" />
  96. </select>
  97. <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.AttFjaccpBase">
  98. insert into ATT_FJACCP_BASE( <include refid="table_columns" /> )
  99. values ( <include refid="entity_properties" /> )
  100. </insert>
  101. <delete id="delete" parameterType="java.lang.String">
  102. update ATT_FJACCP_BASE set DATA_STAT='9' where ID = #{id}
  103. </delete>
  104. <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.AttFjaccpBase">
  105. delete from ATT_FJACCP_BASE <include refid="page_where" />
  106. </delete>
  107. <update id="deleteInFlag" parameterType="java.lang.String">
  108. update ATT_FJACCP_BASE set flag_valid = 0 where ID = #{id}
  109. </update>
  110. <update id="update" parameterType="cn.com.goldenwater.dcproj.model.AttFjaccpBase">
  111. update ATT_FJACCP_BASE
  112. <trim prefix="set" suffixOverrides=",">
  113. <if test="name != null and name != ''">NAME = #{name},</if>
  114. <if test="adCode != null and adCode != ''">AD_CODE = #{adCode},</if>
  115. <if test="adName != null and adName != ''">AD_NAME = #{adName},</if>
  116. <if test="busAddr != null and busAddr != ''">BUS_ADDR = #{busAddr},</if>
  117. <if test="conPers != null and conPers != ''">CON_PERS = #{conPers},</if>
  118. <if test="conPersTel != null and conPersTel != ''">CON_PERS_TEL = #{conPersTel},</if>
  119. <if test="centerX != null and centerX != ''">CENTER_X = #{centerX},</if>
  120. <if test="centerY != null and centerY != ''">CENTER_Y = #{centerY},</if>
  121. <if test="gdX != null and gdX != ''">GD_X = #{gdX},</if>
  122. <if test="gdY != null and gdY != ''">GD_Y = #{gdY},</if>
  123. <if test="persId != null and persId != ''">PERS_ID = #{persId},</if>
  124. <if test="intm != null">INTM = #{intm},</if>
  125. <if test="uptm != null">UPTM = #{uptm},</if>
  126. <if test="note != null and note != ''">NOTE = #{note},</if>
  127. <if test="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
  128. <if test="isCnfm != null and isCnfm != ''">IS_CNFM = #{isCnfm},</if>
  129. </trim>
  130. <where>ID = #{id}</where>
  131. </update>
  132. <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.AttFjaccpBase">
  133. update ATT_FJACCP_BASE
  134. <trim prefix="set" suffixOverrides=",">
  135. <if test="name != null and name != ''">NAME = #{name},</if>
  136. <if test="adCode != null and adCode != ''">AD_CODE = #{adCode},</if>
  137. <if test="adName != null and adName != ''">AD_NAME = #{adName},</if>
  138. <if test="busAddr != null and busAddr != ''">BUS_ADDR = #{busAddr},</if>
  139. <if test="conPers != null and conPers != ''">CON_PERS = #{conPers},</if>
  140. <if test="conPersTel != null and conPersTel != ''">CON_PERS_TEL = #{conPersTel},</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. <if test="isCnfm != null and isCnfm != ''">IS_CNFM = #{isCnfm},</if>
  151. </trim>
  152. <include refid="page_where" />
  153. </update>
  154. <!-- 其他自定义SQL -->
  155. <select id="getObjId" resultType="cn.com.goldenwater.dcproj.model.AttFjaccpBase">
  156. SELECT
  157. <include refid="table_columns"/>
  158. FROM ATT_FJACCP_BASE
  159. WHERE ID = (SELECT CODE FROM BIS_INSP_ALL_OBJ WHERE OBJ_ID = #{objId})
  160. </select>
  161. </mapper>