AMarjorEnrollMapper.xml 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  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.ie.mapper.AMarjorEnrollMapper">
  6. <resultMap type="AMarjorEnroll" id="AMarjorEnrollResult">
  7. <result property="id" column="id" />
  8. <result property="year" column="year" />
  9. <result property="universityId" column="universityId" />
  10. <result property="universityName" column="universityName" />
  11. <result property="majorGroup" column="majorGroup" />
  12. <result property="majorName" column="majorName" />
  13. <result property="majorDirection" column="majorDirection" />
  14. <result property="enrollTotal" column="enrollTotal" />
  15. <result property="addedTotal" column="addedTotal" />
  16. <result property="twoTotal" column="twoTotal" />
  17. <result property="threeTotal" column="threeTotal" />
  18. </resultMap>
  19. <sql id="selectAMarjorEnrollVo">
  20. select id, year, universityId, universityName, majorGroup, majorName, majorDirection, enrollTotal, addedTotal, twoTotal, threeTotal from a_marjor_enroll
  21. </sql>
  22. <select id="selectAMarjorEnrollList" parameterType="AMarjorEnroll" resultMap="AMarjorEnrollResult">
  23. <include refid="selectAMarjorEnrollVo"/>
  24. <where>
  25. <if test="year != null "> and year = #{year}</if>
  26. <if test="universityId != null "> and universityId = #{universityId}</if>
  27. <if test="universityName != null and universityName != ''"> and universityName like concat('%', #{universityName}, '%')</if>
  28. <if test="majorGroup != null and majorGroup != ''"> and majorGroup = #{majorGroup}</if>
  29. <if test="majorName != null and majorName != ''"> and majorName like concat('%', #{majorName}, '%')</if>
  30. <if test="majorDirection != null and majorDirection != ''"> and majorDirection = #{majorDirection}</if>
  31. <if test="enrollTotal != null "> and enrollTotal = #{enrollTotal}</if>
  32. <if test="addedTotal != null "> and addedTotal = #{addedTotal}</if>
  33. <if test="twoTotal != null "> and twoTotal = #{twoTotal}</if>
  34. <if test="threeTotal != null "> and threeTotal = #{threeTotal}</if>
  35. </where>
  36. </select>
  37. <select id="selectAMarjorEnrollById" parameterType="Long" resultMap="AMarjorEnrollResult">
  38. <include refid="selectAMarjorEnrollVo"/>
  39. where id = #{id}
  40. </select>
  41. <insert id="insertAMarjorEnroll" parameterType="AMarjorEnroll" useGeneratedKeys="true" keyProperty="id">
  42. insert into a_marjor_enroll
  43. <trim prefix="(" suffix=")" suffixOverrides=",">
  44. <if test="year != null">year,</if>
  45. <if test="universityId != null">universityId,</if>
  46. <if test="universityName != null">universityName,</if>
  47. <if test="majorGroup != null">majorGroup,</if>
  48. <if test="majorName != null">majorName,</if>
  49. <if test="majorDirection != null">majorDirection,</if>
  50. <if test="enrollTotal != null">enrollTotal,</if>
  51. <if test="addedTotal != null">addedTotal,</if>
  52. <if test="twoTotal != null">twoTotal,</if>
  53. <if test="threeTotal != null">threeTotal,</if>
  54. </trim>
  55. <trim prefix="values (" suffix=")" suffixOverrides=",">
  56. <if test="year != null">#{year},</if>
  57. <if test="universityId != null">#{universityId},</if>
  58. <if test="universityName != null">#{universityName},</if>
  59. <if test="majorGroup != null">#{majorGroup},</if>
  60. <if test="majorName != null">#{majorName},</if>
  61. <if test="majorDirection != null">#{majorDirection},</if>
  62. <if test="enrollTotal != null">#{enrollTotal},</if>
  63. <if test="addedTotal != null">#{addedTotal},</if>
  64. <if test="twoTotal != null">#{twoTotal},</if>
  65. <if test="threeTotal != null">#{threeTotal},</if>
  66. </trim>
  67. </insert>
  68. <update id="updateAMarjorEnroll" parameterType="AMarjorEnroll">
  69. update a_marjor_enroll
  70. <trim prefix="SET" suffixOverrides=",">
  71. <if test="year != null">year = #{year},</if>
  72. <if test="universityId != null">universityId = #{universityId},</if>
  73. <if test="universityName != null">universityName = #{universityName},</if>
  74. <if test="majorGroup != null">majorGroup = #{majorGroup},</if>
  75. <if test="majorName != null">majorName = #{majorName},</if>
  76. <if test="majorDirection != null">majorDirection = #{majorDirection},</if>
  77. <if test="enrollTotal != null">enrollTotal = #{enrollTotal},</if>
  78. <if test="addedTotal != null">addedTotal = #{addedTotal},</if>
  79. <if test="twoTotal != null">twoTotal = #{twoTotal},</if>
  80. <if test="threeTotal != null">threeTotal = #{threeTotal},</if>
  81. </trim>
  82. where id = #{id}
  83. </update>
  84. <delete id="deleteAMarjorEnrollById" parameterType="Long">
  85. delete from a_marjor_enroll where id = #{id}
  86. </delete>
  87. <delete id="deleteAMarjorEnrollByIds" parameterType="String">
  88. delete from a_marjor_enroll where id in
  89. <foreach item="id" collection="array" open="(" separator="," close=")">
  90. #{id}
  91. </foreach>
  92. </delete>
  93. </mapper>