SyTestSelectCategoryMapper.xml 3.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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.sy.mapper.SyTestSelectCategoryMapper">
  6. <resultMap type="SyTestSelectCategory" id="SyTestSelectCategoryResult">
  7. <result property="id" column="id" />
  8. <result property="examineeId" column="examinee_id" />
  9. <result property="customerCode" column="customer_code" />
  10. <result property="majorCategoryCode" column="major_category_code" />
  11. <result property="state" column="state" />
  12. <result property="ranking" column="ranking" />
  13. <result property="createTime" column="create_time" />
  14. </resultMap>
  15. <sql id="selectSyTestSelectCategoryVo">
  16. select id, examinee_id, customer_code, major_category_code, state, ranking, create_time from sy_test_select_category
  17. </sql>
  18. <select id="selectSyTestSelectCategoryList" parameterType="SyTestSelectCategory" resultMap="SyTestSelectCategoryResult">
  19. <include refid="selectSyTestSelectCategoryVo"/>
  20. <where>
  21. <if test="examineeId != null "> and examinee_id = #{examineeId}</if>
  22. <if test="customerCode != null and customerCode != ''"> and customer_code = #{customerCode}</if>
  23. <if test="majorCategoryCode != null and majorCategoryCode != ''"> and major_category_code = #{majorCategoryCode}</if>
  24. <if test="state != null "> and state = #{state}</if>
  25. <if test="ranking != null "> and ranking = #{ranking}</if>
  26. </where>
  27. </select>
  28. <select id="selectSyTestSelectCategoryById" parameterType="Long" resultMap="SyTestSelectCategoryResult">
  29. <include refid="selectSyTestSelectCategoryVo"/>
  30. where id = #{id}
  31. </select>
  32. <insert id="insertSyTestSelectCategory" parameterType="SyTestSelectCategory" useGeneratedKeys="true" keyProperty="id">
  33. insert into sy_test_select_category
  34. <trim prefix="(" suffix=")" suffixOverrides=",">
  35. <if test="examineeId != null">examinee_id,</if>
  36. <if test="customerCode != null">customer_code,</if>
  37. <if test="majorCategoryCode != null">major_category_code,</if>
  38. <if test="state != null">state,</if>
  39. <if test="ranking != null">ranking,</if>
  40. <if test="createTime != null">create_time,</if>
  41. </trim>
  42. <trim prefix="values (" suffix=")" suffixOverrides=",">
  43. <if test="examineeId != null">#{examineeId},</if>
  44. <if test="customerCode != null">#{customerCode},</if>
  45. <if test="majorCategoryCode != null">#{majorCategoryCode},</if>
  46. <if test="state != null">#{state},</if>
  47. <if test="ranking != null">#{ranking},</if>
  48. <if test="createTime != null">#{createTime},</if>
  49. </trim>
  50. </insert>
  51. <update id="updateSyTestSelectCategory" parameterType="SyTestSelectCategory">
  52. update sy_test_select_category
  53. <trim prefix="SET" suffixOverrides=",">
  54. <if test="examineeId != null">examinee_id = #{examineeId},</if>
  55. <if test="customerCode != null">customer_code = #{customerCode},</if>
  56. <if test="majorCategoryCode != null">major_category_code = #{majorCategoryCode},</if>
  57. <if test="state != null">state = #{state},</if>
  58. <if test="ranking != null">ranking = #{ranking},</if>
  59. <if test="createTime != null">create_time = #{createTime},</if>
  60. </trim>
  61. where id = #{id}
  62. </update>
  63. <delete id="deleteSyTestSelectCategoryById" parameterType="Long">
  64. delete from sy_test_select_category where id = #{id}
  65. </delete>
  66. <delete id="deleteSyTestSelectCategoryByIds" parameterType="String">
  67. delete from sy_test_select_category where id in
  68. <foreach item="id" collection="array" open="(" separator="," close=")">
  69. #{id}
  70. </foreach>
  71. </delete>
  72. </mapper>