THomeSetterMapper.xml 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  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.bussiness.mapper.THomeSetterMapper">
  6. <resultMap type="com.ruoyi.bussiness.domain.THomeSetter" id="THomeSetterResult">
  7. <result property="id" column="id" />
  8. <result property="title" column="title" />
  9. <result property="author" column="author" />
  10. <result property="content" column="content" />
  11. <result property="createTime" column="create_time" />
  12. <result property="imgUrl" column="img_url" />
  13. <result property="sort" column="sort" />
  14. <result property="isShow" column="is_show" />
  15. <result property="languageName" column="language_name" />
  16. <result property="likesNum" column="likes_num" />
  17. <result property="homeType" column="home_type" />
  18. <result property="modelType" column="model_type" />
  19. <result property="searchValue" column="search_value" />
  20. </resultMap>
  21. <sql id="selectTHomeSetterVo">
  22. select id, title, author, content, create_time, img_url, sort, is_show, language_name, likes_num, home_type, model_type, search_value from t_home_setter
  23. </sql>
  24. <select id="selectTHomeSetterList" parameterType="THomeSetter" resultMap="THomeSetterResult">
  25. <include refid="selectTHomeSetterVo"/>
  26. <where>
  27. <if test="title != null and title != ''"> and title = #{title}</if>
  28. <if test="author != null and author != ''"> and author = #{author}</if>
  29. <if test="content != null and content != ''"> and content = #{content}</if>
  30. <if test="imgUrl != null and imgUrl != ''"> and img_url = #{imgUrl}</if>
  31. <if test="sort != null "> and sort = #{sort}</if>
  32. <if test="isShow != null "> and is_show = #{isShow}</if>
  33. <if test="languageName != null and languageName != ''"> and language_name like concat('%', #{languageName}, '%')</if>
  34. <if test="likesNum != null "> and likes_num = #{likesNum}</if>
  35. <if test="homeType != null "> and home_type = #{homeType}</if>
  36. <if test="modelType != null "> and model_type = #{modelType}</if>
  37. <if test="searchValue != null and searchValue != ''"> and search_value = #{searchValue}</if>
  38. </where>
  39. </select>
  40. <select id="selectTHomeSetterById" parameterType="Long" resultMap="THomeSetterResult">
  41. <include refid="selectTHomeSetterVo"/>
  42. where id = #{id}
  43. </select>
  44. <insert id="insertTHomeSetter" parameterType="THomeSetter" useGeneratedKeys="true" keyProperty="id">
  45. insert into t_home_setter
  46. <trim prefix="(" suffix=")" suffixOverrides=",">
  47. <if test="title != null and title != ''">title,</if>
  48. <if test="author != null">author,</if>
  49. <if test="content != null">content,</if>
  50. <if test="createTime != null">create_time,</if>
  51. <if test="imgUrl != null">img_url,</if>
  52. <if test="sort != null">sort,</if>
  53. <if test="isShow != null">is_show,</if>
  54. <if test="languageName != null">language_name,</if>
  55. <if test="likesNum != null">likes_num,</if>
  56. <if test="homeType != null">home_type,</if>
  57. <if test="modelType != null">model_type,</if>
  58. <if test="searchValue != null">search_value,</if>
  59. </trim>
  60. <trim prefix="values (" suffix=")" suffixOverrides=",">
  61. <if test="title != null and title != ''">#{title},</if>
  62. <if test="author != null">#{author},</if>
  63. <if test="content != null">#{content},</if>
  64. <if test="createTime != null">#{createTime},</if>
  65. <if test="imgUrl != null">#{imgUrl},</if>
  66. <if test="sort != null">#{sort},</if>
  67. <if test="isShow != null">#{isShow},</if>
  68. <if test="languageName != null">#{languageName},</if>
  69. <if test="likesNum != null">#{likesNum},</if>
  70. <if test="homeType != null">#{homeType},</if>
  71. <if test="modelType != null">#{modelType},</if>
  72. <if test="searchValue != null">#{searchValue},</if>
  73. </trim>
  74. </insert>
  75. <update id="updateTHomeSetter" parameterType="THomeSetter">
  76. update t_home_setter
  77. <trim prefix="SET" suffixOverrides=",">
  78. <if test="title != null and title != ''">title = #{title},</if>
  79. <if test="author != null">author = #{author},</if>
  80. <if test="content != null">content = #{content},</if>
  81. <if test="createTime != null">create_time = #{createTime},</if>
  82. <if test="imgUrl != null">img_url = #{imgUrl},</if>
  83. <if test="sort != null">sort = #{sort},</if>
  84. <if test="isShow != null">is_show = #{isShow},</if>
  85. <if test="languageName != null">language_name = #{languageName},</if>
  86. <if test="likesNum != null">likes_num = #{likesNum},</if>
  87. <if test="homeType != null">home_type = #{homeType},</if>
  88. <if test="modelType != null">model_type = #{modelType},</if>
  89. <if test="searchValue != null">search_value = #{searchValue},</if>
  90. </trim>
  91. where id = #{id}
  92. </update>
  93. <delete id="deleteTHomeSetterById" parameterType="Long">
  94. delete from t_home_setter where id = #{id}
  95. </delete>
  96. <delete id="deleteTHomeSetterByIds" parameterType="String">
  97. delete from t_home_setter where id in
  98. <foreach item="id" collection="array" open="(" separator="," close=")">
  99. #{id}
  100. </foreach>
  101. </delete>
  102. </mapper>