UserFootprintMapper.xml 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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.system.mapper.UserFootprintMapper">
  6. <resultMap type="UserFootprint" id="UserFootprintResult">
  7. <result property="id" column="id" />
  8. <result property="userId" column="user_id" />
  9. <result property="mdId" column="md_id" />
  10. <result property="cretim" column="cretim" />
  11. </resultMap>
  12. <sql id="selectUserFootprintVo">
  13. select id, user_id, md_id, cretim from user_footprint
  14. </sql>
  15. <select id="selectUserFootprintList" parameterType="UserFootprint" resultMap="UserFootprintResult">
  16. <include refid="selectUserFootprintVo"/>
  17. <where>
  18. <if test="userId != null "> and user_id = #{userId}</if>
  19. <if test="mdId != null "> and md_id = #{mdId}</if>
  20. <if test="cretim != null "> and cretim = #{cretim}</if>
  21. </where>
  22. order by id desc
  23. </select>
  24. <select id="selectUserFootprintById" parameterType="Long" resultMap="UserFootprintResult">
  25. <include refid="selectUserFootprintVo"/>
  26. where id = #{id}
  27. </select>
  28. <insert id="insertUserFootprint" parameterType="UserFootprint" useGeneratedKeys="true" keyProperty="id">
  29. insert into user_footprint
  30. <trim prefix="(" suffix=")" suffixOverrides=",">
  31. <if test="userId != null">user_id,</if>
  32. <if test="mdId != null">md_id,</if>
  33. <if test="cretim != null">cretim,</if>
  34. </trim>
  35. <trim prefix="values (" suffix=")" suffixOverrides=",">
  36. <if test="userId != null">#{userId},</if>
  37. <if test="mdId != null">#{mdId},</if>
  38. <if test="cretim != null">#{cretim},</if>
  39. </trim>
  40. </insert>
  41. <update id="updateUserFootprint" parameterType="UserFootprint">
  42. update user_footprint
  43. <trim prefix="SET" suffixOverrides=",">
  44. <if test="userId != null">user_id = #{userId},</if>
  45. <if test="mdId != null">md_id = #{mdId},</if>
  46. <if test="cretim != null">cretim = #{cretim},</if>
  47. </trim>
  48. where id = #{id}
  49. </update>
  50. <delete id="deleteUserFootprintById" parameterType="Long">
  51. delete from user_footprint where id = #{id}
  52. </delete>
  53. <delete id="deleteUserFootprintByIds" parameterType="String">
  54. delete from user_footprint where id in
  55. <foreach item="id" collection="array" open="(" separator="," close=")">
  56. #{id}
  57. </foreach>
  58. </delete>
  59. </mapper>