BBusiWishUniversitiesDepartmentMajorMapper.xml 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  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.BBusiWishUniversitiesDepartmentMajorMapper">
  6. <resultMap type="BBusiWishUniversitiesDepartmentMajor" id="BBusiWishUniversitiesDepartmentMajorResult">
  7. <result property="id" column="id" />
  8. <result property="code" column="code" />
  9. <result property="name" column="name" />
  10. <result property="departmentId" column="departmentId" />
  11. <result property="level" column="level" />
  12. <result property="levelText" column="levelText" />
  13. <result property="collegeCode" column="collegeCode" />
  14. <result property="createTime" column="createTime" />
  15. <result property="updateTime" column="updateTime" />
  16. </resultMap>
  17. <sql id="selectBBusiWishUniversitiesDepartmentMajorVo">
  18. select id, code, name, departmentId, level, levelText, collegeCode, createTime, updateTime from b_busi_wish_universities_department_major
  19. </sql>
  20. <select id="selectBBusiWishUniversitiesDepartmentMajorList" parameterType="BBusiWishUniversitiesDepartmentMajor" resultMap="BBusiWishUniversitiesDepartmentMajorResult">
  21. <include refid="selectBBusiWishUniversitiesDepartmentMajorVo"/>
  22. <where>
  23. <if test="code != null and code != ''"> and code = #{code}</if>
  24. <if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
  25. <if test="departmentId != null and departmentId != ''"> and departmentId = #{departmentId}</if>
  26. <if test="level != null and level != ''"> and level = #{level}</if>
  27. <if test="levelText != null and levelText != ''"> and levelText = #{levelText}</if>
  28. <if test="collegeCode != null and collegeCode != ''"> and collegeCode = #{collegeCode}</if>
  29. <if test="createTime != null "> and createTime = #{createTime}</if>
  30. <if test="updateTime != null "> and updateTime = #{updateTime}</if>
  31. </where>
  32. </select>
  33. <select id="selectBBusiWishUniversitiesDepartmentMajorById" parameterType="String" resultMap="BBusiWishUniversitiesDepartmentMajorResult">
  34. <include refid="selectBBusiWishUniversitiesDepartmentMajorVo"/>
  35. where id = #{id}
  36. </select>
  37. <insert id="insertBBusiWishUniversitiesDepartmentMajor" parameterType="BBusiWishUniversitiesDepartmentMajor">
  38. insert into b_busi_wish_universities_department_major
  39. <trim prefix="(" suffix=")" suffixOverrides=",">
  40. <if test="id != null">id,</if>
  41. <if test="code != null and code != ''">code,</if>
  42. <if test="name != null and name != ''">name,</if>
  43. <if test="departmentId != null and departmentId != ''">departmentId,</if>
  44. <if test="level != null">level,</if>
  45. <if test="levelText != null">levelText,</if>
  46. <if test="collegeCode != null and collegeCode != ''">collegeCode,</if>
  47. <if test="createTime != null">createTime,</if>
  48. <if test="updateTime != null">updateTime,</if>
  49. </trim>
  50. <trim prefix="values (" suffix=")" suffixOverrides=",">
  51. <if test="id != null">#{id},</if>
  52. <if test="code != null and code != ''">#{code},</if>
  53. <if test="name != null and name != ''">#{name},</if>
  54. <if test="departmentId != null and departmentId != ''">#{departmentId},</if>
  55. <if test="level != null">#{level},</if>
  56. <if test="levelText != null">#{levelText},</if>
  57. <if test="collegeCode != null and collegeCode != ''">#{collegeCode},</if>
  58. <if test="createTime != null">#{createTime},</if>
  59. <if test="updateTime != null">#{updateTime},</if>
  60. </trim>
  61. </insert>
  62. <update id="updateBBusiWishUniversitiesDepartmentMajor" parameterType="BBusiWishUniversitiesDepartmentMajor">
  63. update b_busi_wish_universities_department_major
  64. <trim prefix="SET" suffixOverrides=",">
  65. <if test="code != null and code != ''">code = #{code},</if>
  66. <if test="name != null and name != ''">name = #{name},</if>
  67. <if test="departmentId != null and departmentId != ''">departmentId = #{departmentId},</if>
  68. <if test="level != null">level = #{level},</if>
  69. <if test="levelText != null">levelText = #{levelText},</if>
  70. <if test="collegeCode != null and collegeCode != ''">collegeCode = #{collegeCode},</if>
  71. <if test="createTime != null">createTime = #{createTime},</if>
  72. <if test="updateTime != null">updateTime = #{updateTime},</if>
  73. </trim>
  74. where id = #{id}
  75. </update>
  76. <delete id="deleteBBusiWishUniversitiesDepartmentMajorById" parameterType="String">
  77. delete from b_busi_wish_universities_department_major where id = #{id}
  78. </delete>
  79. <delete id="deleteBBusiWishUniversitiesDepartmentMajorByIds" parameterType="String">
  80. delete from b_busi_wish_universities_department_major where id in
  81. <foreach item="id" collection="array" open="(" separator="," close=")">
  82. #{id}
  83. </foreach>
  84. </delete>
  85. </mapper>