猫妈狗爸伴宠师小程序后端代码
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.

84 lines
3.7 KiB

11 months 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.AppWalletMapper">
  6. <resultMap type="AppWallet" id="AppWalletResult">
  7. <result property="id" column="id" />
  8. <result property="price" column="price" />
  9. <result property="remark" column="remark" />
  10. <result property="createTime" column="create_time" />
  11. <result property="createBy" column="create_by" />
  12. <result property="updateTime" column="update_time" />
  13. <result property="updateBy" column="update_by" />
  14. <result property="delFlag" column="del_flag" />
  15. </resultMap>
  16. <sql id="selectAppWalletVo">
  17. select id, price, remark, create_time, create_by, update_time, update_by, del_flag from app_wallet
  18. </sql>
  19. <select id="selectAppWalletList" parameterType="AppWallet" resultMap="AppWalletResult">
  20. <include refid="selectAppWalletVo"/>
  21. <where>
  22. <if test="price != null "> and price = #{price}</if>
  23. </where>
  24. </select>
  25. <select id="selectAppWalletById" parameterType="Long" resultMap="AppWalletResult">
  26. <include refid="selectAppWalletVo"/>
  27. where id = #{id}
  28. </select>
  29. <select id="getAppWalletByUserId" resultType="com.ruoyi.model.domain.AppWallet">
  30. select wallet.* from app_wallet wallet join app_users users where users.user_id = #{usersId} and wallet.del_flag = 0 and users.del_flag = 0;
  31. </select>
  32. <insert id="insertAppWallet" parameterType="AppWallet">
  33. insert into app_wallet
  34. <trim prefix="(" suffix=")" suffixOverrides=",">
  35. <if test="id != null">id,</if>
  36. <if test="price != null">price,</if>
  37. <if test="remark != null">remark,</if>
  38. <if test="createTime != null">create_time,</if>
  39. <if test="createBy != null">create_by,</if>
  40. <if test="updateTime != null">update_time,</if>
  41. <if test="updateBy != null">update_by,</if>
  42. <if test="delFlag != null">del_flag,</if>
  43. </trim>
  44. <trim prefix="values (" suffix=")" suffixOverrides=",">
  45. <if test="id != null">#{id},</if>
  46. <if test="price != null">#{price},</if>
  47. <if test="remark != null">#{remark},</if>
  48. <if test="createTime != null">#{createTime},</if>
  49. <if test="createBy != null">#{createBy},</if>
  50. <if test="updateTime != null">#{updateTime},</if>
  51. <if test="updateBy != null">#{updateBy},</if>
  52. <if test="delFlag != null">#{delFlag},</if>
  53. </trim>
  54. </insert>
  55. <update id="updateAppWallet" parameterType="AppWallet">
  56. update app_wallet
  57. <trim prefix="SET" suffixOverrides=",">
  58. <if test="price != null">price = #{price},</if>
  59. <if test="remark != null">remark = #{remark},</if>
  60. <if test="createTime != null">create_time = #{createTime},</if>
  61. <if test="createBy != null">create_by = #{createBy},</if>
  62. <if test="updateTime != null">update_time = #{updateTime},</if>
  63. <if test="updateBy != null">update_by = #{updateBy},</if>
  64. <if test="delFlag != null">del_flag = #{delFlag},</if>
  65. </trim>
  66. where id = #{id}
  67. </update>
  68. <delete id="deleteAppWalletById" parameterType="Long">
  69. delete from app_wallet where id = #{id}
  70. </delete>
  71. <delete id="deleteAppWalletByIds" parameterType="String">
  72. delete from app_wallet where id in
  73. <foreach item="id" collection="array" open="(" separator="," close=")">
  74. #{id}
  75. </foreach>
  76. </delete>
  77. </mapper>