StationLocationMapper.xml 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  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="com.tuoren.forward.mapper.StationLocationMapper">
  4. <resultMap id="BaseResultMap" type="com.tuoren.forward.entity.StationLocation">
  5. <id column="id" jdbcType="VARCHAR" property="id" />
  6. <result column="mnc" jdbcType="CHAR" property="mnc" />
  7. <result column="lac" jdbcType="VARCHAR" property="lac" />
  8. <result column="ci" jdbcType="VARCHAR" property="ci" />
  9. <result column="lng" jdbcType="VARCHAR" property="lng" />
  10. <result column="lat" jdbcType="VARCHAR" property="lat" />
  11. <result column="address" jdbcType="VARCHAR" property="address" />
  12. <result column="radius" jdbcType="VARCHAR" property="radius" />
  13. <result column="createtime" jdbcType="TIMESTAMP" property="createtime" />
  14. <result column="modifytime" jdbcType="TIMESTAMP" property="modifytime" />
  15. </resultMap>
  16. <sql id="Base_Column_List">
  17. id, mnc, lac, ci, lng, lat, address, radius, createtime, modifytime
  18. </sql>
  19. <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
  20. select
  21. <include refid="Base_Column_List" />
  22. from station_location
  23. where id = #{id,jdbcType=VARCHAR}
  24. </select>
  25. <select id="selectOne" parameterType="java.lang.String" resultMap="BaseResultMap">
  26. select
  27. <include refid="Base_Column_List" />
  28. from station_location
  29. where mnc = #{mnc,jdbcType=VARCHAR} and lac = #{lac,jdbcType=VARCHAR}
  30. and ci = #{ci,jdbcType=VARCHAR} limit 1
  31. </select>
  32. <select id="select" parameterType="StationLocationDto" resultMap="BaseResultMap">
  33. select
  34. <include refid="Base_Column_List" />
  35. from station_location
  36. <where>
  37. <if test="keyWord != null and keyWord != ''">
  38. (
  39. lac like CONCAT('%',#{keyWord,jdbcType=VARCHAR},'%')
  40. or
  41. ci like CONCAT('%',#{keyWord,jdbcType=VARCHAR},'%')
  42. )
  43. </if>
  44. </where>
  45. <if test="sort != null and sort != ''">
  46. order by ${sort}
  47. <if test="order != null "> ${order}</if>
  48. </if>
  49. </select>
  50. <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
  51. delete from station_location
  52. where id = #{id,jdbcType=VARCHAR}
  53. </delete>
  54. <insert id="insert" parameterType="com.tuoren.forward.entity.StationLocation">
  55. insert into station_location (id, mnc, lac, ci,
  56. lng, lat, address,
  57. radius, createtime, modifytime
  58. )
  59. values (#{id,jdbcType=VARCHAR}, #{mnc,jdbcType=CHAR}, #{lac,jdbcType=VARCHAR}, #{ci,jdbcType=VARCHAR},
  60. #{lng,jdbcType=VARCHAR}, #{lat,jdbcType=VARCHAR}, #{address,jdbcType=VARCHAR},
  61. #{radius,jdbcType=VARCHAR}, #{createtime,jdbcType=TIMESTAMP}, #{modifytime,jdbcType=TIMESTAMP}
  62. )
  63. </insert>
  64. <insert id="insertSelective" parameterType="com.tuoren.forward.entity.StationLocation">
  65. insert into station_location
  66. <trim prefix="(" suffix=")" suffixOverrides=",">
  67. <if test="id != null">
  68. id,
  69. </if>
  70. <if test="mnc != null">
  71. mnc,
  72. </if>
  73. <if test="lac != null">
  74. lac,
  75. </if>
  76. <if test="ci != null">
  77. ci,
  78. </if>
  79. <if test="lng != null">
  80. lng,
  81. </if>
  82. <if test="lat != null">
  83. lat,
  84. </if>
  85. <if test="address != null">
  86. address,
  87. </if>
  88. <if test="radius != null">
  89. radius,
  90. </if>
  91. <if test="createtime != null">
  92. createtime,
  93. </if>
  94. <if test="modifytime != null">
  95. modifytime,
  96. </if>
  97. </trim>
  98. <trim prefix="values (" suffix=")" suffixOverrides=",">
  99. <if test="id != null">
  100. #{id,jdbcType=VARCHAR},
  101. </if>
  102. <if test="mnc != null">
  103. #{mnc,jdbcType=CHAR},
  104. </if>
  105. <if test="lac != null">
  106. #{lac,jdbcType=VARCHAR},
  107. </if>
  108. <if test="ci != null">
  109. #{ci,jdbcType=VARCHAR},
  110. </if>
  111. <if test="lng != null">
  112. #{lng,jdbcType=VARCHAR},
  113. </if>
  114. <if test="lat != null">
  115. #{lat,jdbcType=VARCHAR},
  116. </if>
  117. <if test="address != null">
  118. #{address,jdbcType=VARCHAR},
  119. </if>
  120. <if test="radius != null">
  121. #{radius,jdbcType=VARCHAR},
  122. </if>
  123. <if test="createtime != null">
  124. #{createtime,jdbcType=TIMESTAMP},
  125. </if>
  126. <if test="modifytime != null">
  127. #{modifytime,jdbcType=TIMESTAMP},
  128. </if>
  129. </trim>
  130. </insert>
  131. <update id="updateByPrimaryKeySelective" parameterType="com.tuoren.forward.entity.StationLocation">
  132. update station_location
  133. <set>
  134. <if test="mnc != null">
  135. mnc = #{mnc,jdbcType=CHAR},
  136. </if>
  137. <if test="lac != null">
  138. lac = #{lac,jdbcType=VARCHAR},
  139. </if>
  140. <if test="ci != null">
  141. ci = #{ci,jdbcType=VARCHAR},
  142. </if>
  143. <if test="lng != null">
  144. lng = #{lng,jdbcType=VARCHAR},
  145. </if>
  146. <if test="lat != null">
  147. lat = #{lat,jdbcType=VARCHAR},
  148. </if>
  149. <if test="address != null">
  150. address = #{address,jdbcType=VARCHAR},
  151. </if>
  152. <if test="radius != null">
  153. radius = #{radius,jdbcType=VARCHAR},
  154. </if>
  155. <if test="createtime != null">
  156. createtime = #{createtime,jdbcType=TIMESTAMP},
  157. </if>
  158. <if test="modifytime != null">
  159. modifytime = #{modifytime,jdbcType=TIMESTAMP},
  160. </if>
  161. </set>
  162. where id = #{id,jdbcType=VARCHAR}
  163. </update>
  164. <update id="updateByPrimaryKey" parameterType="com.tuoren.forward.entity.StationLocation">
  165. update station_location
  166. set mnc = #{mnc,jdbcType=CHAR},
  167. lac = #{lac,jdbcType=VARCHAR},
  168. ci = #{ci,jdbcType=VARCHAR},
  169. lng = #{lng,jdbcType=VARCHAR},
  170. lat = #{lat,jdbcType=VARCHAR},
  171. address = #{address,jdbcType=VARCHAR},
  172. radius = #{radius,jdbcType=VARCHAR},
  173. createtime = #{createtime,jdbcType=TIMESTAMP},
  174. modifytime = #{modifytime,jdbcType=TIMESTAMP}
  175. where id = #{id,jdbcType=VARCHAR}
  176. </update>
  177. </mapper>