MarkerMapper.xml 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="com.huijy.management.mapper.MarkerMapper">
  6. <resultMap type="Marker" id="MarkerResult">
  7. <result property="markerId" column="marker_id" />
  8. <result property="markerName" column="marker_name" />
  9. <result property="markerType" column="marker_type" />
  10. <result property="address" column="address" />
  11. <result property="showPictures" column="show_pictures" />
  12. <result property="iconPictures" column="icon_pictures" />
  13. <result property="lat" column="lat" />
  14. <result property="lng" column="lng" />
  15. <result property="labelText" column="label_text" />
  16. <result property="businessHours" column="business_hours" />
  17. <result property="shapeType" column="shape_type" />
  18. <result property="locationSet" column="location_set" />
  19. <result property="radius" column="radius" />
  20. <result property="briefContent" column="brief_content" />
  21. <result property="content" column="content" />
  22. </resultMap>
  23. <sql id="selectMarkerVo">
  24. select marker_id, marker_name, marker_type, address, show_pictures, icon_pictures, lat, lng, label_text, business_hours, shape_type, location_set, radius, brief_content, content from t_marker
  25. </sql>
  26. <select id="selectMarkerList" parameterType="Marker" resultMap="MarkerResult">
  27. <include refid="selectMarkerVo"/>
  28. <where>
  29. <if test="markerName != null and markerName != ''"> and marker_name like concat('%', #{markerName}, '%')</if>
  30. <if test="markerType != null and markerType != ''"> and marker_type = #{markerType}</if>
  31. </where>
  32. </select>
  33. <select id="selectMarkerByMarkerId" parameterType="Long" resultMap="MarkerResult">
  34. <include refid="selectMarkerVo"/>
  35. where marker_id = #{markerId}
  36. </select>
  37. <insert id="insertMarker" parameterType="Marker">
  38. insert into t_marker
  39. <trim prefix="(" suffix=")" suffixOverrides=",">
  40. <if test="markerId != null">marker_id,</if>
  41. <if test="markerName != null">marker_name,</if>
  42. <if test="markerType != null">marker_type,</if>
  43. <if test="address != null">address,</if>
  44. <if test="showPictures != null">show_pictures,</if>
  45. <if test="iconPictures != null">icon_pictures,</if>
  46. <if test="lat != null">lat,</if>
  47. <if test="lng != null">lng,</if>
  48. <if test="labelText != null">label_text,</if>
  49. <if test="businessHours != null">business_hours,</if>
  50. <if test="shapeType != null">shape_type,</if>
  51. <if test="locationSet != null">location_set,</if>
  52. <if test="radius != null">radius,</if>
  53. <if test="briefContent != null">brief_content,</if>
  54. <if test="content != null">content,</if>
  55. </trim>
  56. <trim prefix="values (" suffix=")" suffixOverrides=",">
  57. <if test="markerId != null">#{markerId},</if>
  58. <if test="markerName != null">#{markerName},</if>
  59. <if test="markerType != null">#{markerType},</if>
  60. <if test="address != null">#{address},</if>
  61. <if test="showPictures != null">#{showPictures},</if>
  62. <if test="iconPictures != null">#{iconPictures},</if>
  63. <if test="lat != null">#{lat},</if>
  64. <if test="lng != null">#{lng},</if>
  65. <if test="labelText != null">#{labelText},</if>
  66. <if test="businessHours != null">#{businessHours},</if>
  67. <if test="shapeType != null">#{shapeType},</if>
  68. <if test="locationSet != null">#{locationSet},</if>
  69. <if test="radius != null">#{radius},</if>
  70. <if test="briefContent != null">#{briefContent},</if>
  71. <if test="content != null">#{content},</if>
  72. </trim>
  73. </insert>
  74. <update id="updateMarker" parameterType="Marker">
  75. update t_marker
  76. <trim prefix="SET" suffixOverrides=",">
  77. <if test="markerName != null">marker_name = #{markerName},</if>
  78. <if test="markerType != null">marker_type = #{markerType},</if>
  79. <if test="address != null">address = #{address},</if>
  80. <if test="showPictures != null">show_pictures = #{showPictures},</if>
  81. <if test="iconPictures != null">icon_pictures = #{iconPictures},</if>
  82. <if test="lat != null">lat = #{lat},</if>
  83. <if test="lng != null">lng = #{lng},</if>
  84. <if test="labelText != null">label_text = #{labelText},</if>
  85. <if test="businessHours != null">business_hours = #{businessHours},</if>
  86. <if test="shapeType != null">shape_type = #{shapeType},</if>
  87. <if test="locationSet != null">location_set = #{locationSet},</if>
  88. <if test="radius != null">radius = #{radius},</if>
  89. <if test="briefContent != null">brief_content = #{briefContent},</if>
  90. <if test="content != null">content = #{content},</if>
  91. </trim>
  92. where marker_id = #{markerId}
  93. </update>
  94. <delete id="deleteMarkerByMarkerId" parameterType="Long">
  95. delete from t_marker where marker_id = #{markerId}
  96. </delete>
  97. <delete id="deleteMarkerByMarkerIds" parameterType="String">
  98. delete from t_marker where marker_id in
  99. <foreach item="markerId" collection="array" open="(" separator="," close=")">
  100. #{markerId}
  101. </foreach>
  102. </delete>
  103. </mapper>