NightMarketMapper.xml 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  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.ruoyi.system.mapper.NightMarketMapper">
  6. <resultMap type="NightMarket" id="NightMarketResult">
  7. <result property="id" column="id" />
  8. <result property="name" column="name" />
  9. <result property="image" column="image" />
  10. <result property="area" column="area" />
  11. <result property="address" column="address" />
  12. <result property="longitude" column="longitude" />
  13. <result property="latitude" column="latitude" />
  14. <result property="briefIntroduction" column="brief_introduction" />
  15. <result property="openBusiness" column="open_business" />
  16. <result property="windingUp" column="winding_up" />
  17. <result property="sort" column="sort" />
  18. <result property="userId" column="user_id" />
  19. <result property="cretim" column="cretim" />
  20. <result property="state" column="state" />
  21. <result property="telephone" column="telephone" />
  22. <result property="userName" column="user_name" />
  23. <result property="logo" column="logo" />
  24. <result property="offShelf" column="off_shelf" />
  25. <result property="hygieneLicence" column="hygiene_licence" />
  26. </resultMap>
  27. <sql id="selectNightMarketVo">
  28. select id, name, image, area, address, longitude, latitude, brief_introduction, open_business, winding_up, sort, user_id, cretim, state, telephone, user_name, logo, off_shelf, hygiene_licence from night_market
  29. </sql>
  30. <select id="selectNightMarketList" parameterType="NightMarket" resultMap="NightMarketResult">
  31. <include refid="selectNightMarketVo"/>
  32. <where>
  33. <if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
  34. <if test="image != null and image != ''"> and image = #{image}</if>
  35. <if test="area != null and area != ''"> and area = #{area}</if>
  36. <if test="address != null and address != ''"> and address = #{address}</if>
  37. <if test="longitude != null "> and longitude = #{longitude}</if>
  38. <if test="latitude != null "> and latitude = #{latitude}</if>
  39. <if test="briefIntroduction != null and briefIntroduction != ''"> and brief_introduction = #{briefIntroduction}</if>
  40. <if test="openBusiness != null and openBusiness != ''"> and open_business = #{openBusiness}</if>
  41. <if test="windingUp != null and windingUp != ''"> and winding_up = #{windingUp}</if>
  42. <if test="sort != null "> and sort = #{sort}</if>
  43. <if test="userId != null "> and user_id = #{userId}</if>
  44. <if test="cretim != null "> and cretim = #{cretim}</if>
  45. <if test="state != null "> and state = #{state}</if>
  46. <if test="telephone != null and telephone != ''"> and telephone = #{telephone}</if>
  47. <if test="userName != null and userName != ''"> and user_name like concat('%', #{userName}, '%')</if>
  48. <if test="logo != null and logo != ''"> and logo = #{logo}</if>
  49. <if test="offShelf != null and offShelf != ''"> and off_shelf = #{offShelf}</if>
  50. <if test="hygieneLicence != null and hygieneLicence != ''"> and hygiene_licence = #{hygieneLicence}</if>
  51. </where>
  52. </select>
  53. <select id="selectNightMarketById" parameterType="Long" resultMap="NightMarketResult">
  54. <include refid="selectNightMarketVo"/>
  55. where id = #{id}
  56. </select>
  57. <insert id="insertNightMarket" parameterType="NightMarket" useGeneratedKeys="true" keyProperty="id">
  58. insert into night_market
  59. <trim prefix="(" suffix=")" suffixOverrides=",">
  60. <if test="name != null">name,</if>
  61. <if test="image != null">image,</if>
  62. <if test="area != null">area,</if>
  63. <if test="address != null">address,</if>
  64. <if test="longitude != null">longitude,</if>
  65. <if test="latitude != null">latitude,</if>
  66. <if test="briefIntroduction != null">brief_introduction,</if>
  67. <if test="openBusiness != null">open_business,</if>
  68. <if test="windingUp != null">winding_up,</if>
  69. <if test="sort != null">sort,</if>
  70. <if test="userId != null">user_id,</if>
  71. <if test="cretim != null">cretim,</if>
  72. <if test="state != null">state,</if>
  73. <if test="telephone != null">telephone,</if>
  74. <if test="userName != null">user_name,</if>
  75. <if test="logo != null">logo,</if>
  76. <if test="offShelf != null">off_shelf,</if>
  77. <if test="hygieneLicence != null">hygiene_licence,</if>
  78. </trim>
  79. <trim prefix="values (" suffix=")" suffixOverrides=",">
  80. <if test="name != null">#{name},</if>
  81. <if test="image != null">#{image},</if>
  82. <if test="area != null">#{area},</if>
  83. <if test="address != null">#{address},</if>
  84. <if test="longitude != null">#{longitude},</if>
  85. <if test="latitude != null">#{latitude},</if>
  86. <if test="briefIntroduction != null">#{briefIntroduction},</if>
  87. <if test="openBusiness != null">#{openBusiness},</if>
  88. <if test="windingUp != null">#{windingUp},</if>
  89. <if test="sort != null">#{sort},</if>
  90. <if test="userId != null">#{userId},</if>
  91. <if test="cretim != null">#{cretim},</if>
  92. <if test="state != null">#{state},</if>
  93. <if test="telephone != null">#{telephone},</if>
  94. <if test="userName != null">#{userName},</if>
  95. <if test="logo != null">#{logo},</if>
  96. <if test="offShelf != null">#{offShelf},</if>
  97. <if test="hygieneLicence != null">#{hygieneLicence},</if>
  98. </trim>
  99. </insert>
  100. <update id="updateNightMarket" parameterType="NightMarket">
  101. update night_market
  102. <trim prefix="SET" suffixOverrides=",">
  103. <if test="name != null">name = #{name},</if>
  104. <if test="image != null">image = #{image},</if>
  105. <if test="area != null">area = #{area},</if>
  106. <if test="address != null">address = #{address},</if>
  107. <if test="longitude != null">longitude = #{longitude},</if>
  108. <if test="latitude != null">latitude = #{latitude},</if>
  109. <if test="briefIntroduction != null">brief_introduction = #{briefIntroduction},</if>
  110. <if test="openBusiness != null">open_business = #{openBusiness},</if>
  111. <if test="windingUp != null">winding_up = #{windingUp},</if>
  112. <if test="sort != null">sort = #{sort},</if>
  113. <if test="userId != null">user_id = #{userId},</if>
  114. <if test="cretim != null">cretim = #{cretim},</if>
  115. <if test="state != null">state = #{state},</if>
  116. <if test="telephone != null">telephone = #{telephone},</if>
  117. <if test="userName != null">user_name = #{userName},</if>
  118. <if test="logo != null">logo = #{logo},</if>
  119. <if test="offShelf != null">off_shelf = #{offShelf},</if>
  120. <if test="hygieneLicence != null">hygiene_licence = #{hygieneLicence},</if>
  121. </trim>
  122. where id = #{id}
  123. </update>
  124. <delete id="deleteNightMarketById" parameterType="Long">
  125. delete from night_market where id = #{id}
  126. </delete>
  127. <delete id="deleteNightMarketByIds" parameterType="String">
  128. delete from night_market where id in
  129. <foreach item="id" collection="array" open="(" separator="," close=")">
  130. #{id}
  131. </foreach>
  132. </delete>
  133. </mapper>