AttWintBaseBDao.xml 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240
  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.AttWintBaseBDao">
  4. <resultMap type="cn.com.goldenwater.dcproj.model.AttWintBaseB" id="attWintBaseBResultMap">
  5. <result property="id" column="ID"/>
  6. <result property="wintCode" column="WINT_CODE"/>
  7. <result property="wintName" column="WINT_NAME"/>
  8. <result property="adCode" column="AD_CODE"/>
  9. <result property="adName" column="AD_NAME"/>
  10. <result property="wintPos" column="WINT_POS"/>
  11. <result property="wainLong" column="WAIN_LONG"/>
  12. <result property="wainLat" column="WAIN_LAT"/>
  13. <result property="locWrz1rdName" column="LOC_WRZ1RD_NAME"/>
  14. <result property="locWrz2rdName" column="LOC_WRZ2RD_NAME"/>
  15. <result property="locWrz3rdName" column="LOC_WRZ3RD_NAME"/>
  16. <result property="wainType" column="WAIN_TYPE"/>
  17. <result property="charDepNm" column="CHAR_DEP_NM"/>
  18. <result property="charDepPers" column="CHAR_DEP_PERS"/>
  19. <result property="charDepTel" column="CHAR_DEP_TEL"/>
  20. <result property="wainIntName" column="WAIN_INT_NAME"/>
  21. <result property="wainIntType" column="WAIN_INT_TYPE"/>
  22. <result property="wainWasoType" column="WAIN_WASO_TYPE"/>
  23. <result property="wainWasoName" column="WAIN_WASO_NAME"/>
  24. <result property="desQ" column="DES_Q"/>
  25. <result property="desDayQ" column="DES_DAY_Q"/>
  26. <result property="desYearQ" column="DES_YEAR_Q"/>
  27. <result property="inTm" column="IN_TM"/>
  28. <result property="upTm" column="UP_TM"/>
  29. <result property="gdX" column="GD_X"/>
  30. <result property="gdY" column="GD_Y"/>
  31. </resultMap>
  32. <sql id="table_columns">
  33. ID,
  34. WINT_CODE,
  35. WINT_NAME,
  36. AD_CODE,
  37. AD_NAME,
  38. WINT_POS,
  39. WAIN_LONG,
  40. WAIN_LAT,
  41. LOC_WRZ1RD_NAME,
  42. LOC_WRZ2RD_NAME,
  43. LOC_WRZ3RD_NAME,
  44. WAIN_TYPE,
  45. CHAR_DEP_NM,
  46. CHAR_DEP_PERS,
  47. CHAR_DEP_TEL,
  48. WAIN_INT_NAME,
  49. WAIN_INT_TYPE,
  50. WAIN_WASO_TYPE,
  51. WAIN_WASO_NAME,
  52. DES_Q,
  53. DES_DAY_Q,
  54. DES_YEAR_Q,
  55. IN_TM,
  56. UP_TM,
  57. GD_X,
  58. GD_Y
  59. </sql>
  60. <sql id="entity_properties">
  61. #{id},
  62. #{wintCode},
  63. #{wintName},
  64. #{adCode},
  65. #{adName},
  66. #{wintPos},
  67. #{wainLong},
  68. #{wainLat},
  69. #{locWrz1rdName},
  70. #{locWrz2rdName},
  71. #{locWrz3rdName},
  72. #{wainType},
  73. #{charDepNm},
  74. #{charDepPers},
  75. #{charDepTel},
  76. #{wainIntName},
  77. #{wainIntType},
  78. #{wainWasoType},
  79. #{wainWasoName},
  80. #{desQ},
  81. #{desDayQ},
  82. #{desYearQ},
  83. #{inTm},
  84. #{upTm},
  85. #{gdX},
  86. #{gdY}
  87. </sql>
  88. <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
  89. <sql id="page_where">
  90. <trim prefix="where" prefixOverrides="and | or ">
  91. <if test="wintCode != null and wintCode != ''">and WINT_CODE = #{wintCode}</if>
  92. <if test="wintName != null and wintName != ''">and WINT_NAME like '%${wintName}%'</if>
  93. <if test="adCode != null and adCode != ''">and AD_CODE like '${adCode}%'</if>
  94. <if test="adName != null and adName != ''">and AD_NAME = #{adName}</if>
  95. <if test="wintPos != null and wintPos != ''">and WINT_POS = #{wintPos}</if>
  96. <if test="wainLong != null and wainLong != ''">and WAIN_LONG = #{wainLong}</if>
  97. <if test="wainLat != null and wainLat != ''">and WAIN_LAT = #{wainLat}</if>
  98. <if test="locWrz1rdName != null and locWrz1rdName != ''">and LOC_WRZ1RD_NAME = #{locWrz1rdName}</if>
  99. <if test="locWrz2rdName != null and locWrz2rdName != ''">and LOC_WRZ2RD_NAME = #{locWrz2rdName}</if>
  100. <if test="locWrz3rdName != null and locWrz3rdName != ''">and LOC_WRZ3RD_NAME = #{locWrz3rdName}</if>
  101. <if test="wainType != null and wainType != ''">and WAIN_TYPE = #{wainType}</if>
  102. <if test="charDepNm != null and charDepNm != ''">and CHAR_DEP_NM = #{charDepNm}</if>
  103. <if test="charDepPers != null and charDepPers != ''">and CHAR_DEP_PERS = #{charDepPers}</if>
  104. <if test="charDepTel != null and charDepTel != ''">and CHAR_DEP_TEL = #{charDepTel}</if>
  105. <if test="wainIntName != null and wainIntName != ''">and WAIN_INT_NAME = #{wainIntName}</if>
  106. <if test="wainIntType != null and wainIntType != ''">and WAIN_INT_TYPE = #{wainIntType}</if>
  107. <if test="wainWasoType != null and wainWasoType != ''">and WAIN_WASO_TYPE = #{wainWasoType}</if>
  108. <if test="wainWasoName != null and wainWasoName != ''">and WAIN_WASO_NAME = #{wainWasoName}</if>
  109. <if test="desQ != null and desQ != ''">and DES_Q = #{desQ}</if>
  110. <if test="desDayQ != null and desDayQ != ''">and DES_DAY_Q = #{desDayQ}</if>
  111. <if test="desYearQ != null and desYearQ != ''">and DES_YEAR_Q = #{desYearQ}</if>
  112. <if test="inTm != null">and IN_TM = #{inTm}</if>
  113. <if test="upTm != null">and UP_TM = #{upTm}</if>
  114. <if test="gdX != null and gdX != ''">AND GD_X = #{gdX}</if>
  115. <if test="gdY != null and gdY != ''">AND GD_Y = #{gdY}</if>
  116. </trim>
  117. </sql>
  118. <select id="get" resultMap="attWintBaseBResultMap" parameterType="String" >
  119. select <include refid="table_columns" /> from ATT_WINT_BASE_B where ID = #{id}
  120. </select>
  121. <select id="getBy" resultMap="attWintBaseBResultMap">
  122. select <include refid="table_columns" /> from ATT_WINT_BASE_B <include refid="page_where" />
  123. </select>
  124. <select id="findAll" resultMap="attWintBaseBResultMap">
  125. select <include refid="table_columns" /> from ATT_WINT_BASE_B
  126. </select>
  127. <select id="findList" resultMap="attWintBaseBResultMap">
  128. select <include refid="table_columns" /> from ATT_WINT_BASE_B <include refid="page_where" />
  129. </select>
  130. <select id="selectCount" resultType="int" >
  131. select count(ID) from ATT_WINT_BASE_B <include refid="page_where" />
  132. </select>
  133. <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.AttWintBaseB">
  134. insert into ATT_WINT_BASE_B( <include refid="table_columns" /> )
  135. values ( <include refid="entity_properties" /> )
  136. </insert>
  137. <delete id="delete" parameterType="java.lang.String">
  138. delete from ATT_WINT_BASE_B where ID = #{id}
  139. </delete>
  140. <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.AttWintBaseB">
  141. delete from ATT_WINT_BASE_B <include refid="page_where" />
  142. </delete>
  143. <update id="deleteInFlag" parameterType="java.lang.String">
  144. update ATT_WINT_BASE_B set flag_valid = 0 where ID = #{id}
  145. </update>
  146. <update id="update" parameterType="cn.com.goldenwater.dcproj.model.AttWintBaseB">
  147. update ATT_WINT_BASE_B
  148. <trim prefix="set" suffixOverrides=",">
  149. <if test="wintCode != null and wintCode != ''">WINT_CODE = #{wintCode},</if>
  150. <if test="wintName != null and wintName != ''">WINT_NAME = #{wintName},</if>
  151. <if test="adCode != null and adCode != ''">AD_CODE = #{adCode},</if>
  152. <if test="adName != null and adName != ''">AD_NAME = #{adName},</if>
  153. <if test="wintPos != null and wintPos != ''">WINT_POS = #{wintPos},</if>
  154. <if test="wainLong != null and wainLong != ''">WAIN_LONG = #{wainLong},</if>
  155. <if test="wainLat != null and wainLat != ''">WAIN_LAT = #{wainLat},</if>
  156. <if test="locWrz1rdName != null and locWrz1rdName != ''">LOC_WRZ1RD_NAME = #{locWrz1rdName},</if>
  157. <if test="locWrz2rdName != null and locWrz2rdName != ''">LOC_WRZ2RD_NAME = #{locWrz2rdName},</if>
  158. <if test="locWrz3rdName != null and locWrz3rdName != ''">LOC_WRZ3RD_NAME = #{locWrz3rdName},</if>
  159. <if test="wainType != null and wainType != ''">WAIN_TYPE = #{wainType},</if>
  160. <if test="charDepNm != null and charDepNm != ''">CHAR_DEP_NM = #{charDepNm},</if>
  161. <if test="charDepPers != null and charDepPers != ''">CHAR_DEP_PERS = #{charDepPers},</if>
  162. <if test="charDepTel != null and charDepTel != ''">CHAR_DEP_TEL = #{charDepTel},</if>
  163. <if test="wainIntName != null and wainIntName != ''">WAIN_INT_NAME = #{wainIntName},</if>
  164. <if test="wainIntType != null and wainIntType != ''">WAIN_INT_TYPE = #{wainIntType},</if>
  165. <if test="wainWasoType != null and wainWasoType != ''">WAIN_WASO_TYPE = #{wainWasoType},</if>
  166. <if test="wainWasoName != null and wainWasoName != ''">WAIN_WASO_NAME = #{wainWasoName},</if>
  167. <if test="desQ != null and desQ != ''">DES_Q = #{desQ},</if>
  168. <if test="desDayQ != null and desDayQ != ''">DES_DAY_Q = #{desDayQ},</if>
  169. <if test="desYearQ != null and desYearQ != ''">DES_YEAR_Q = #{desYearQ},</if>
  170. <if test="inTm != null">IN_TM = #{inTm},</if>
  171. <if test="upTm != null">UP_TM = #{upTm},</if>
  172. <if test="gdX != null and gdX != ''">GD_X = #{gdX},</if>
  173. <if test="gdY != null and gdY != ''">GD_Y = #{gdY},</if>
  174. </trim>
  175. <where>ID = #{id}</where>
  176. </update>
  177. <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.AttWintBaseB">
  178. update ATT_WINT_BASE_B
  179. <trim prefix="set" suffixOverrides=",">
  180. <if test="wintCode != null and wintCode != ''">WINT_CODE = #{wintCode},</if>
  181. <if test="wintName != null and wintName != ''">WINT_NAME = #{wintName},</if>
  182. <if test="adCode != null and adCode != ''">AD_CODE = #{adCode},</if>
  183. <if test="adName != null and adName != ''">AD_NAME = #{adName},</if>
  184. <if test="wintPos != null and wintPos != ''">WINT_POS = #{wintPos},</if>
  185. <if test="wainLong != null and wainLong != ''">WAIN_LONG = #{wainLong},</if>
  186. <if test="wainLat != null and wainLat != ''">WAIN_LAT = #{wainLat},</if>
  187. <if test="locWrz1rdName != null and locWrz1rdName != ''">LOC_WRZ1RD_NAME = #{locWrz1rdName},</if>
  188. <if test="locWrz2rdName != null and locWrz2rdName != ''">LOC_WRZ2RD_NAME = #{locWrz2rdName},</if>
  189. <if test="locWrz3rdName != null and locWrz3rdName != ''">LOC_WRZ3RD_NAME = #{locWrz3rdName},</if>
  190. <if test="wainType != null and wainType != ''">WAIN_TYPE = #{wainType},</if>
  191. <if test="charDepNm != null and charDepNm != ''">CHAR_DEP_NM = #{charDepNm},</if>
  192. <if test="charDepPers != null and charDepPers != ''">CHAR_DEP_PERS = #{charDepPers},</if>
  193. <if test="charDepTel != null and charDepTel != ''">CHAR_DEP_TEL = #{charDepTel},</if>
  194. <if test="wainIntName != null and wainIntName != ''">WAIN_INT_NAME = #{wainIntName},</if>
  195. <if test="wainIntType != null and wainIntType != ''">WAIN_INT_TYPE = #{wainIntType},</if>
  196. <if test="wainWasoType != null and wainWasoType != ''">WAIN_WASO_TYPE = #{wainWasoType},</if>
  197. <if test="wainWasoName != null and wainWasoName != ''">WAIN_WASO_NAME = #{wainWasoName},</if>
  198. <if test="desQ != null and desQ != ''">DES_Q = #{desQ},</if>
  199. <if test="desDayQ != null and desDayQ != ''">DES_DAY_Q = #{desDayQ},</if>
  200. <if test="desYearQ != null and desYearQ != ''">DES_YEAR_Q = #{desYearQ},</if>
  201. <if test="inTm != null">IN_TM = #{inTm},</if>
  202. <if test="upTm != null">UP_TM = #{upTm},</if>
  203. <if test="gdX != null and gdX != ''">GD_X = #{gdX},</if>
  204. <if test="gdY != null and gdY != ''">GD_Y = #{gdY},</if>
  205. </trim>
  206. <include refid="page_where" />
  207. </update>
  208. <!-- 其他自定义SQL -->
  209. <select id="findListByPersId" parameterType="cn.com.goldenwater.dcproj.param.PersObjParam" resultMap="attWintBaseBResultMap">
  210. SELECT T.* FROM ATT_WINT_BASE_B T WHERE 1 = 1
  211. <if test="adCode != null and adCode != ''">and T.AD_CODE LIKE '${adCode}%'</if>
  212. <if test="rsName != null and rsName != ''">and T.WINT_NAME LIKE '%${rsName}%'</if>
  213. <if test="maxLgtd != null and maxLgtd != '' and minLgtd != null and minLgtd != ''">and T.WAIN_LONG BETWEEN
  214. #{minLgtd} AND #{maxLgtd}
  215. </if>
  216. <if test="maxLttd != null and maxLttd != '' and minLttd != null and minLttd != ''">and T.WAIN_LAT BETWEEN
  217. #{minLttd} AND #{maxLttd}
  218. </if>
  219. </select>
  220. </mapper>