BBusiWishRecordsMapper.xml 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  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.BBusiWishRecordsMapper">
  6. <resultMap type="BBusiWishRecords" id="BBusiWishRecordsResult">
  7. <result property="id" column="id" />
  8. <result property="customerCode" column="customerCode" />
  9. <result property="type" column="type" />
  10. <result property="code" column="code" />
  11. <result property="name" column="name" />
  12. <result property="batch" column="batch" />
  13. <result property="batchName" column="batchName" />
  14. <result property="detail" column="detail" />
  15. <result property="userSnapshot" column="userSnapshot" />
  16. <result property="createTime" column="createTime" />
  17. <result property="status" column="status" />
  18. <result property="obsoleted" column="obsoleted" />
  19. </resultMap>
  20. <sql id="selectBBusiWishRecordsVo">
  21. select id, customerCode, type, code, name, batch,batchName, userSnapshot,detail, createTime, status,obsoleted from b_busi_wish_records
  22. </sql>
  23. <select id="selectBBusiWishRecordsList" parameterType="BBusiWishRecords" resultMap="BBusiWishRecordsResult">
  24. <include refid="selectBBusiWishRecordsVo" />
  25. <where>
  26. <if test="id != null"> and id = #{id}</if>
  27. <if test="customerCode != null and customerCode != ''"> and customerCode = #{customerCode}</if>
  28. <if test="type != null "> and type = #{type}</if>
  29. <if test="code != null and code != ''"> and code = #{code}</if>
  30. <if test="name != null and name != '' and !exactName"> and name like concat('%', #{name}, '%')</if>
  31. <if test="name != null and name != '' and exactName"> and name = #{name}</if>
  32. <if test="batch != null and batch != ''"> and batch = #{batch}</if>
  33. <if test="batchName != null and batchName != ''"> and batchName = #{batchName}</if>
  34. <if test="userSnapshot != null and userSnapshot != ''"> and userSnapshot = #{userSnapshot}</if>
  35. <if test="detail != null and detail != ''"> and detail = #{detail}</if>
  36. <if test="createTime != null "> and createTime = #{createTime}</if>
  37. <if test="status != null "> and status = #{status}</if>
  38. <if test="obsoleted != null "> and obsoleted = #{obsoleted}</if>
  39. </where>
  40. order by id desc
  41. </select>
  42. <select id="selectBBusiWishRecordsById" parameterType="Long" resultMap="BBusiWishRecordsResult">
  43. <include refid="selectBBusiWishRecordsVo" />
  44. where id = #{id}
  45. </select>
  46. <insert id="insertBBusiWishRecords" parameterType="BBusiWishRecords" useGeneratedKeys="true" keyProperty="id">
  47. insert into b_busi_wish_records
  48. <trim prefix="(" suffix=")" suffixOverrides=",">
  49. <if test="customerCode != null and customerCode != ''">customerCode,</if>
  50. <if test="type != null">type,</if>
  51. <if test="code != null">code,</if>
  52. <if test="name != null">name,</if>
  53. <if test="batch != null">batch,</if>
  54. <if test="batchName != null">batchName,</if>
  55. <if test="userSnapshot != null">userSnapshot,</if>
  56. <if test="detail != null">detail,</if>
  57. <if test="createTime != null">createTime,</if>
  58. <if test="status != null">status,</if>
  59. <if test="obsoleted != null">obsoleted,</if>
  60. </trim>
  61. <trim prefix="values (" suffix=")" suffixOverrides=",">
  62. <if test="customerCode != null and customerCode != ''">#{customerCode},</if>
  63. <if test="type != null">#{type},</if>
  64. <if test="code != null">#{code},</if>
  65. <if test="name != null">#{name},</if>
  66. <if test="batch != null">#{batch},</if>
  67. <if test="batchName != null">#{batchName},</if>
  68. <if test="userSnapshot != null">#{userSnapshot},</if>
  69. <if test="detail != null">#{detail},</if>
  70. <if test="createTime != null">#{createTime},</if>
  71. <if test="status != null">#{status},</if>
  72. <if test="obsoleted != null">#{obsoleted},</if>
  73. </trim>
  74. </insert>
  75. <update id="updateBBusiWishRecords" parameterType="BBusiWishRecords">
  76. update b_busi_wish_records
  77. <trim prefix="SET" suffixOverrides=",">
  78. <if test="customerCode != null and customerCode != ''">customerCode = #{customerCode},</if>
  79. <if test="type != null">type = #{type},</if>
  80. <if test="code != null">code = #{code},</if>
  81. <if test="name != null">name = #{name},</if>
  82. <if test="batch != null">batch = #{batch},</if>
  83. <if test="batchName != null">batchName = #{batchName},</if>
  84. <if test="userSnapshot != null">userSnapshot = #{userSnapshot},</if>
  85. <if test="detail != null">detail = #{detail},</if>
  86. <if test="createTime != null">createTime = #{createTime},</if>
  87. <if test="status != null">status = #{status},</if>
  88. <if test="obsoleted != null">obsoleted = #{obsoleted},</if>
  89. </trim>
  90. where id = #{id}
  91. </update>
  92. <update id="updateObsoleteByUser" parameterType="Long">
  93. update b_busi_wish_records wr set wr.obsoleted = true where wr.customerCode = #{userId}
  94. </update>
  95. <delete id="deleteBBusiWishRecordsById" parameterType="Long">
  96. delete from b_busi_wish_records where id = #{id}
  97. </delete>
  98. <delete id="deleteBBusiWishRecordsByIds" parameterType="String">
  99. delete from b_busi_wish_records where id in
  100. <foreach item="id" collection="array" open="(" separator="," close=")">
  101. #{id}
  102. </foreach>
  103. </delete>
  104. </mapper>