BusiWishUniversitiesTopMapper.xml 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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.BusiWishUniversitiesTopMapper">
  6. <resultMap type="BusiWishUniversitiesTop" id="BusiWishUniversitiesTopResult">
  7. <result property="id" column="id" />
  8. <result property="univerid" column="univerId" />
  9. <result property="code" column="code" />
  10. <result property="name" column="name" />
  11. <result property="logo" column="logo" />
  12. <result property="favorities" column="favorities" />
  13. </resultMap>
  14. <sql id="selectBusiWishUniversitiesTopVo">
  15. select id, univerId, code, name, logo, favorities from b_busi_wish_universities_top
  16. </sql>
  17. <select id="selectBusiWishUniversitiesTopList" parameterType="BusiWishUniversitiesTop" resultMap="BusiWishUniversitiesTopResult">
  18. <include refid="selectBusiWishUniversitiesTopVo" />
  19. <where>
  20. <if test="univerid != null "> and univerId = #{univerid}</if>
  21. <if test="code != null and code != ''"> and code = #{code}</if>
  22. <if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
  23. <if test="logo != null and logo != ''"> and logo = #{logo}</if>
  24. <if test="favorities != null "> and favorities = #{favorities}</if>
  25. </where>
  26. <if test="params.orderBy!=null and params.orderBy != ''"> order by #{params.orderBy} </if>
  27. </select>
  28. <select id="selectBusiWishUniversitiesTopById" parameterType="Long" resultMap="BusiWishUniversitiesTopResult">
  29. <include refid="selectBusiWishUniversitiesTopVo" />
  30. where id = #{id}
  31. </select>
  32. <insert id="insertBusiWishUniversitiesTop" parameterType="BusiWishUniversitiesTop" useGeneratedKeys="true" keyProperty="id">
  33. insert into b_busi_wish_universities_top
  34. <trim prefix="(" suffix=")" suffixOverrides=",">
  35. <if test="univerid != null">univerId,</if>
  36. <if test="code != null">code,</if>
  37. <if test="name != null">name,</if>
  38. <if test="logo != null">logo,</if>
  39. <if test="favorities != null">favorities,</if>
  40. </trim>
  41. <trim prefix="values (" suffix=")" suffixOverrides=",">
  42. <if test="univerid != null">#{univerid},</if>
  43. <if test="code != null">#{code},</if>
  44. <if test="name != null">#{name},</if>
  45. <if test="logo != null">#{logo},</if>
  46. <if test="favorities != null">#{favorities},</if>
  47. </trim>
  48. </insert>
  49. <update id="updateBusiWishUniversitiesTop" parameterType="BusiWishUniversitiesTop">
  50. update b_busi_wish_universities_top
  51. <trim prefix="SET" suffixOverrides=",">
  52. <if test="univerid != null">univerId = #{univerid},</if>
  53. <if test="code != null">code = #{code},</if>
  54. <if test="name != null">name = #{name},</if>
  55. <if test="logo != null">logo = #{logo},</if>
  56. <if test="favorities != null">favorities = #{favorities},</if>
  57. </trim>
  58. where id = #{id}
  59. </update>
  60. <delete id="deleteBusiWishUniversitiesTopById" parameterType="Long">
  61. delete from b_busi_wish_universities_top where id = #{id}
  62. </delete>
  63. <delete id="deleteBusiWishUniversitiesTopByIds" parameterType="String">
  64. delete from b_busi_wish_universities_top where id in
  65. <foreach item="id" collection="array" open="(" separator="," close=")">
  66. #{id}
  67. </foreach>
  68. </delete>
  69. </mapper>