PosCollectMapper.xml 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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.PosCollectMapper">
  6. <resultMap type="PosCollect" id="PosCollectResult">
  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="selectPosCollectVo">
  13. select id, user_id, md_id, cretim from pos_collect
  14. </sql>
  15. <select id="selectPosCollectList" parameterType="PosCollect" resultMap="PosCollectResult">
  16. <include refid="selectPosCollectVo"/>
  17. <where>
  18. <if test="userId != null "> and user_id = #{userId}</if>
  19. <if test="mdId != null "> and md_id = #{mdId}</if>
  20. </where>
  21. order by id desc
  22. </select>
  23. <select id="selectPosCollectById" parameterType="Long" resultMap="PosCollectResult">
  24. <include refid="selectPosCollectVo"/>
  25. where id = #{id}
  26. </select>
  27. <insert id="insertPosCollect" parameterType="PosCollect" useGeneratedKeys="true" keyProperty="id">
  28. insert into pos_collect
  29. <trim prefix="(" suffix=")" suffixOverrides=",">
  30. <if test="userId != null">user_id,</if>
  31. <if test="mdId != null">md_id,</if>
  32. <if test="cretim != null">cretim,</if>
  33. </trim>
  34. <trim prefix="values (" suffix=")" suffixOverrides=",">
  35. <if test="userId != null">#{userId},</if>
  36. <if test="mdId != null">#{mdId},</if>
  37. <if test="cretim != null">#{cretim},</if>
  38. </trim>
  39. </insert>
  40. <update id="updatePosCollect" parameterType="PosCollect">
  41. update pos_collect
  42. <trim prefix="SET" suffixOverrides=",">
  43. <if test="userId != null">user_id = #{userId},</if>
  44. <if test="mdId != null">md_id = #{mdId},</if>
  45. <if test="cretim != null">cretim = #{cretim},</if>
  46. </trim>
  47. where id = #{id}
  48. </update>
  49. <delete id="deletePosCollectById" parameterType="Long">
  50. delete from pos_collect where id = #{id}
  51. </delete>
  52. <delete id="deletePosCollectByIds" parameterType="String">
  53. delete from pos_collect where id in
  54. <foreach item="id" collection="array" open="(" separator="," close=")">
  55. #{id}
  56. </foreach>
  57. </delete>
  58. </mapper>