BBusiMbtiQuestionsMapper.xml 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  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.BBusiMbtiQuestionsMapper">
  6. <resultMap type="BBusiMbtiQuestions" id="BBusiMbtiQuestionsResult">
  7. <result property="id" column="id" />
  8. <result property="stepId" column="stepId" />
  9. <result property="no" column="no" />
  10. <result property="title" column="title" />
  11. <result property="optionA" column="option_a" />
  12. <result property="optionB" column="option_b" />
  13. <result property="valueA" column="value_a" />
  14. <result property="valueB" column="value_b" />
  15. <result property="status" column="status" />
  16. </resultMap>
  17. <sql id="selectBBusiMbtiQuestionsVo">
  18. select id, stepId, no, title, option_a, option_b, value_a, value_b, status from b_busi_mbti_questions
  19. </sql>
  20. <select id="selectBBusiMbtiQuestionsList" parameterType="BBusiMbtiQuestions" resultMap="BBusiMbtiQuestionsResult">
  21. <include refid="selectBBusiMbtiQuestionsVo" />
  22. <where>
  23. <if test="stepId != null "> and stepId = #{stepId}</if>
  24. <if test="no != null "> and no = #{no}</if>
  25. <if test="title != null and title != ''"> and title = #{title}</if>
  26. <if test="optionA != null and optionA != ''"> and option_a = #{optionA}</if>
  27. <if test="optionB != null and optionB != ''"> and option_b = #{optionB}</if>
  28. <if test="valueA != null and valueA != ''"> and value_a = #{valueA}</if>
  29. <if test="valueB != null and valueB != ''"> and value_b = #{valueB}</if>
  30. <if test="status != null "> and status = #{status}</if>
  31. </where>
  32. order by no
  33. </select>
  34. <select id="selectBBusiMbtiQuestionsById" parameterType="Long" resultMap="BBusiMbtiQuestionsResult">
  35. <include refid="selectBBusiMbtiQuestionsVo" />
  36. where id = #{id}
  37. </select>
  38. <select id="selectByIdList" parameterType="java.util.Collection" resultMap="BBusiMbtiQuestionsResult">
  39. <include refid="selectBBusiMbtiQuestionsVo" />
  40. where id in
  41. <foreach item="id" collection="idList" open="(" separator="," close=")">#{id}</foreach>
  42. </select>
  43. <insert id="insertBBusiMbtiQuestions" parameterType="BBusiMbtiQuestions" useGeneratedKeys="true" keyProperty="id">
  44. insert into b_busi_mbti_questions
  45. <trim prefix="(" suffix=")" suffixOverrides=",">
  46. <if test="stepId != null">stepId,</if>
  47. <if test="no != null">no,</if>
  48. <if test="title != null">title,</if>
  49. <if test="optionA != null">option_a,</if>
  50. <if test="optionB != null">option_b,</if>
  51. <if test="valueA != null">value_a,</if>
  52. <if test="valueB != null">value_b,</if>
  53. <if test="status != null">status,</if>
  54. </trim>
  55. <trim prefix="values (" suffix=")" suffixOverrides=",">
  56. <if test="stepId != null">#{stepId},</if>
  57. <if test="no != null">#{no},</if>
  58. <if test="title != null">#{title},</if>
  59. <if test="optionA != null">#{optionA},</if>
  60. <if test="optionB != null">#{optionB},</if>
  61. <if test="valueA != null">#{valueA},</if>
  62. <if test="valueB != null">#{valueB},</if>
  63. <if test="status != null">#{status},</if>
  64. </trim>
  65. </insert>
  66. <update id="updateBBusiMbtiQuestions" parameterType="BBusiMbtiQuestions">
  67. update b_busi_mbti_questions
  68. <trim prefix="SET" suffixOverrides=",">
  69. <if test="stepId != null">stepId = #{stepId},</if>
  70. <if test="no != null">no = #{no},</if>
  71. <if test="title != null">title = #{title},</if>
  72. <if test="optionA != null">option_a = #{optionA},</if>
  73. <if test="optionB != null">option_b = #{optionB},</if>
  74. <if test="valueA != null">value_a = #{valueA},</if>
  75. <if test="valueB != null">value_b = #{valueB},</if>
  76. <if test="status != null">status = #{status},</if>
  77. </trim>
  78. where id = #{id}
  79. </update>
  80. <delete id="deleteBBusiMbtiQuestionsById" parameterType="Long">
  81. delete from b_busi_mbti_questions where id = #{id}
  82. </delete>
  83. <delete id="deleteBBusiMbtiQuestionsByIds" parameterType="String">
  84. delete from b_busi_mbti_questions where id in
  85. <foreach item="id" collection="array" open="(" separator="," close=")">
  86. #{id}
  87. </foreach>
  88. </delete>
  89. </mapper>