猫妈狗爸伴宠师小程序后端代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

90 lines
4.3 KiB

1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
  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.model.mapper.TrainingMapper">
  6. <resultMap type="Training" id="TrainingResult">
  7. <result property="trainingId" column="training_id" />
  8. <result property="createBy" column="create_by" />
  9. <result property="createTime" column="create_time" />
  10. <result property="delFlag" column="del_flag" />
  11. <result property="profile" column="profile" />
  12. <result property="reamk" column="reamk" />
  13. <result property="trainingAssessType" column="training_assess_type" />
  14. <result property="updateBy" column="update_by" />
  15. <result property="updateTime" column="update_time" />
  16. </resultMap>
  17. <sql id="selectTrainingVo">
  18. select training_id, create_by, create_time, del_flag, profile, reamk, training_assess_type, update_by, update_time from training
  19. </sql>
  20. <select id="selectTrainingList" parameterType="Training" resultMap="TrainingResult">
  21. <include refid="selectTrainingVo"/>
  22. <where>
  23. <if test="profile != null and profile != ''"> and profile = #{profile}</if>
  24. <if test="reamk != null and reamk != ''"> and reamk = #{reamk}</if>
  25. <if test="trainingAssessType != null and trainingAssessType != ''"> and training_assess_type = #{trainingAssessType}</if>
  26. </where>
  27. </select>
  28. <select id="selectTrainingByTrainingId" parameterType="Long" resultMap="TrainingResult">
  29. <include refid="selectTrainingVo"/>
  30. where training_id = #{trainingId}
  31. </select>
  32. <select id="getTrainingList" resultType="com.ruoyi.model.domain.Training">
  33. <include refid="selectTrainingVo"/>
  34. </select>
  35. <insert id="insertTraining" parameterType="Training">
  36. insert into training
  37. <trim prefix="(" suffix=")" suffixOverrides=",">
  38. <if test="trainingId != null">training_id,</if>
  39. <if test="createBy != null">create_by,</if>
  40. <if test="createTime != null">create_time,</if>
  41. <if test="delFlag != null">del_flag,</if>
  42. <if test="profile != null">profile,</if>
  43. <if test="reamk != null">reamk,</if>
  44. <if test="trainingAssessType != null">training_assess_type,</if>
  45. <if test="updateBy != null">update_by,</if>
  46. <if test="updateTime != null">update_time,</if>
  47. </trim>
  48. <trim prefix="values (" suffix=")" suffixOverrides=",">
  49. <if test="trainingId != null">#{trainingId},</if>
  50. <if test="createBy != null">#{createBy},</if>
  51. <if test="createTime != null">#{createTime},</if>
  52. <if test="delFlag != null">#{delFlag},</if>
  53. <if test="profile != null">#{profile},</if>
  54. <if test="reamk != null">#{reamk},</if>
  55. <if test="trainingAssessType != null">#{trainingAssessType},</if>
  56. <if test="updateBy != null">#{updateBy},</if>
  57. <if test="updateTime != null">#{updateTime},</if>
  58. </trim>
  59. </insert>
  60. <update id="updateTraining" parameterType="Training">
  61. update training
  62. <trim prefix="SET" suffixOverrides=",">
  63. <if test="createBy != null">create_by = #{createBy},</if>
  64. <if test="createTime != null">create_time = #{createTime},</if>
  65. <if test="delFlag != null">del_flag = #{delFlag},</if>
  66. <if test="profile != null">profile = #{profile},</if>
  67. <if test="reamk != null">reamk = #{reamk},</if>
  68. <if test="trainingAssessType != null">training_assess_type = #{trainingAssessType},</if>
  69. <if test="updateBy != null">update_by = #{updateBy},</if>
  70. <if test="updateTime != null">update_time = #{updateTime},</if>
  71. </trim>
  72. where training_id = #{trainingId}
  73. </update>
  74. <delete id="deleteTrainingByTrainingId" parameterType="Long">
  75. delete from training where training_id = #{trainingId}
  76. </delete>
  77. <delete id="deleteTrainingByTrainingIds" parameterType="String">
  78. delete from training where training_id in
  79. <foreach item="trainingId" collection="array" open="(" separator="," close=")">
  80. #{trainingId}
  81. </foreach>
  82. </delete>
  83. </mapper>