BWwwNewsRefMapper.xml 3.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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.syzy.mapper.BWwwNewsRefMapper">
  6. <resultMap type="BWwwNewsRef" id="BWwwNewsRefResult">
  7. <result property="id" column="id" />
  8. <result property="type" column="type" />
  9. <result property="subType" column="subType" />
  10. <result property="description" column="description" />
  11. <result property="refIds" column="refIds" />
  12. <result property="location" column="location" />
  13. </resultMap>
  14. <sql id="selectBWwwNewsRefVo">
  15. select id, type, subType, description, refIds, location from b_www_news_ref
  16. </sql>
  17. <select id="selectBWwwNewsRefList" parameterType="BWwwNewsRef" resultMap="BWwwNewsRefResult">
  18. <include refid="selectBWwwNewsRefVo"/>
  19. <where>
  20. <if test="type != null and type != ''"> and type = #{type}</if>
  21. <if test="subType != null and subType != ''"> and subType = #{subType}</if>
  22. <if test="description != null and description != ''"> and description = #{description}</if>
  23. <if test="refIds != null and refIds != ''"> and refIds = #{refIds}</if>
  24. <if test="location != null and location != ''"> and location = #{location}</if>
  25. </where>
  26. </select>
  27. <select id="selectBWwwNewsRefById" parameterType="Long" resultMap="BWwwNewsRefResult">
  28. <include refid="selectBWwwNewsRefVo"/>
  29. where id = #{id}
  30. </select>
  31. <insert id="insertBWwwNewsRef" parameterType="BWwwNewsRef" useGeneratedKeys="true" keyProperty="id">
  32. insert into b_www_news_ref
  33. <trim prefix="(" suffix=")" suffixOverrides=",">
  34. <if test="type != null">type,</if>
  35. <if test="subType != null">subType,</if>
  36. <if test="description != null">description,</if>
  37. <if test="refIds != null">refIds,</if>
  38. <if test="location != null">location,</if>
  39. </trim>
  40. <trim prefix="values (" suffix=")" suffixOverrides=",">
  41. <if test="type != null">#{type},</if>
  42. <if test="subType != null">#{subType},</if>
  43. <if test="description != null">#{description},</if>
  44. <if test="refIds != null">#{refIds},</if>
  45. <if test="location != null">#{location},</if>
  46. </trim>
  47. </insert>
  48. <update id="updateBWwwNewsRef" parameterType="BWwwNewsRef">
  49. update b_www_news_ref
  50. <trim prefix="SET" suffixOverrides=",">
  51. <if test="type != null">type = #{type},</if>
  52. <if test="subType != null">subType = #{subType},</if>
  53. <if test="description != null">description = #{description},</if>
  54. <if test="refIds != null">refIds = #{refIds},</if>
  55. <if test="location != null">location = #{location}</if>
  56. </trim>
  57. where id = #{id}
  58. </update>
  59. <delete id="deleteBWwwNewsRefById" parameterType="Long">
  60. delete from b_www_news_ref where id = #{id}
  61. </delete>
  62. <delete id="deleteBWwwNewsRefByIds" parameterType="String">
  63. delete from b_www_news_ref where id in
  64. <foreach item="id" collection="array" open="(" separator="," close=")">
  65. #{id}
  66. </foreach>
  67. </delete>
  68. </mapper>