CollegeTestMapper.xml 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
  3. <mapper namespace="com.ygj.yuemum.dao.college.CollegeTestDao" >
  4. <resultMap id="BaseResultMap" type="com.ygj.yuemum.domain.college.CollegeTest" >
  5. <id column="id" property="id" jdbcType="INTEGER" />
  6. <result column="core_id" property="core_id" jdbcType="VARCHAR" />
  7. <result column="name" property="name" jdbcType="VARCHAR" />
  8. <result column="score" property="score" jdbcType="INTEGER" />
  9. <result column="desc" property="desc" jdbcType="VARCHAR" />
  10. <result column="comment" property="comment" jdbcType="VARCHAR" />
  11. </resultMap>
  12. <!--获取所有数据-->
  13. <select id="getAll" resultType="com.ygj.yuemum.domain.college.CollegeTest" >
  14. select
  15. *
  16. from college_test
  17. order by id desc
  18. </select>
  19. <select id="selectByPrimaryKey" resultType="com.ygj.yuemum.domain.college.CollegeTest" parameterType="java.lang.Integer" >
  20. select
  21. *
  22. from college_test
  23. where id = #{id,jdbcType=INTEGER}
  24. </select>
  25. <select id="selectByCoreId" resultType="com.ygj.yuemum.domain.college.CollegeTest" parameterType="java.lang.Integer" >
  26. select
  27. *
  28. from college_test
  29. where core_id = #{core_id,jdbcType=INTEGER}
  30. order by seq asc
  31. </select>
  32. <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
  33. delete from college_test
  34. where id = #{id,jdbcType=INTEGER}
  35. </delete>
  36. <insert id="insertSelective" parameterType="com.ygj.yuemum.domain.college.CollegeTest" >
  37. insert into college_test
  38. <trim prefix="(" suffix=")" suffixOverrides="," >
  39. <if test="core_id != null" >
  40. core_id,
  41. </if>
  42. <if test="name != null" >
  43. `name`,
  44. </if>
  45. <if test="score != null" >
  46. score,
  47. </if>
  48. <if test="desc != null" >
  49. `desc`,
  50. </if>
  51. <if test="comment != null" >
  52. `comment`
  53. </if>
  54. </trim>
  55. <trim prefix="values (" suffix=")" suffixOverrides="," >
  56. <if test="core_id != null" >
  57. #{core_id,jdbcType=VARCHAR},
  58. </if>
  59. <if test="name != null" >
  60. #{name,jdbcType=VARCHAR},
  61. </if>
  62. <if test="score != null" >
  63. #{score,jdbcType=INTEGER},
  64. </if>
  65. <if test="desc != null" >
  66. #{desc,jdbcType=VARCHAR},
  67. </if>
  68. <if test="comment != null" >
  69. #{comment,jdbcType=VARCHAR}
  70. </if>
  71. </trim>
  72. </insert>
  73. <update id="updateByPrimaryKeySelective" parameterType="com.ygj.yuemum.domain.college.CollegeTest" >
  74. update college_test
  75. <set >
  76. <if test="core_id != null" >
  77. core_id = #{core_id,jdbcType=VARCHAR},
  78. </if>
  79. <if test="name != null" >
  80. `name` = #{name,jdbcType=VARCHAR},
  81. </if>
  82. <if test="score != null" >
  83. score = #{score ,jdbcType=INTEGER},
  84. </if>
  85. <if test="desc != null" >
  86. `desc` = #{desc,jdbcType=VARCHAR},
  87. </if>
  88. <if test="comment != null" >
  89. `comment` = #{comment,jdbcType=VARCHAR}
  90. </if>
  91. </set>
  92. where id = #{id,jdbcType=INTEGER}
  93. </update>
  94. </mapper>