AdManagementMapper.xml 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  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.web.plotmanage.mapper.AdManagementMapper">
  6. <resultMap type="AdManagement" id="AdManagementResult">
  7. <result property="id" column="id" />
  8. <result property="plotid" column="plotid" />
  9. <result property="flatid" column="flatid" />
  10. <result property="floor" column="floor" />
  11. <result property="area" column="area" />
  12. <result property="status" column="status" />
  13. <result property="rent" column="rent" />
  14. <result property="renttype" column="rentType" />
  15. <result property="addtime" column="addtime" />
  16. <result property="isadd" column="iSadd" />
  17. </resultMap>
  18. <sql id="selectAdManagementVo">
  19. select id, plotid, flatid, floor, area, status, rent, rentType, addtime, iSadd from ad_management
  20. </sql>
  21. <select id="selectAdManagementList" parameterType="AdManagement" resultMap="AdManagementResult">
  22. <include refid="selectAdManagementVo"/>
  23. <where>
  24. <if test="plotid != null and plotid != ''"> and plotid = #{plotid}</if>
  25. <if test="flatid != null and flatid != ''"> and flatid = #{flatid}</if>
  26. <if test="floor != null and floor != ''"> and floor = #{floor}</if>
  27. <if test="area != null and area != ''"> and area = #{area}</if>
  28. <if test="status != null and status != ''"> and status = #{status}</if>
  29. <if test="rent != null and rent != ''"> and rent = #{rent}</if>
  30. <if test="renttype != null and renttype != ''"> and rentType = #{renttype}</if>
  31. <if test="addtime != null "> and addtime = #{addtime}</if>
  32. <if test="isadd != null and isadd != ''"> and iSadd = #{isadd}</if>
  33. </where>
  34. </select>
  35. <select id="selectAdManagementById" parameterType="Long" resultMap="AdManagementResult">
  36. <include refid="selectAdManagementVo"/>
  37. where id = #{id}
  38. </select>
  39. <insert id="insertAdManagement" parameterType="AdManagement" useGeneratedKeys="true" keyProperty="id">
  40. insert into ad_management
  41. <trim prefix="(" suffix=")" suffixOverrides=",">
  42. <if test="plotid != null and plotid != ''">plotid,</if>
  43. <if test="flatid != null and flatid != ''">flatid,</if>
  44. <if test="floor != null">floor,</if>
  45. <if test="area != null">area,</if>
  46. <if test="status != null">status,</if>
  47. <if test="rent != null">rent,</if>
  48. <if test="renttype != null">rentType,</if>
  49. <if test="addtime != null">addtime,</if>
  50. <if test="isadd != null">iSadd,</if>
  51. </trim>
  52. <trim prefix="values (" suffix=")" suffixOverrides=",">
  53. <if test="plotid != null and plotid != ''">#{plotid},</if>
  54. <if test="flatid != null and flatid != ''">#{flatid},</if>
  55. <if test="floor != null">#{floor},</if>
  56. <if test="area != null">#{area},</if>
  57. <if test="status != null">#{status},</if>
  58. <if test="rent != null">#{rent},</if>
  59. <if test="renttype != null">#{renttype},</if>
  60. <if test="addtime != null">#{addtime},</if>
  61. <if test="isadd != null">#{isadd},</if>
  62. </trim>
  63. </insert>
  64. <update id="updateAdManagement" parameterType="AdManagement">
  65. update ad_management
  66. <trim prefix="SET" suffixOverrides=",">
  67. <if test="plotid != null and plotid != ''">plotid = #{plotid},</if>
  68. <if test="flatid != null and flatid != ''">flatid = #{flatid},</if>
  69. <if test="floor != null">floor = #{floor},</if>
  70. <if test="area != null">area = #{area},</if>
  71. <if test="status != null">status = #{status},</if>
  72. <if test="rent != null">rent = #{rent},</if>
  73. <if test="renttype != null">rentType = #{renttype},</if>
  74. <if test="addtime != null">addtime = #{addtime},</if>
  75. <if test="isadd != null">iSadd = #{isadd},</if>
  76. </trim>
  77. where id = #{id}
  78. </update>
  79. <delete id="deleteAdManagementById" parameterType="Long">
  80. delete from ad_management where id = #{id}
  81. </delete>
  82. <delete id="deleteAdManagementByIds" parameterType="String">
  83. delete from ad_management where id in
  84. <foreach item="id" collection="array" open="(" separator="," close=")">
  85. #{id}
  86. </foreach>
  87. </delete>
  88. </mapper>