VipUserQuanyiMapper.xml 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  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.VipUserQuanyiMapper">
  6. <resultMap type="VipUserQuanyi" id="VipUserQuanyiResult">
  7. <result property="id" column="id" />
  8. <result property="quanyiId" column="quanyi_id" />
  9. <result property="userId" column="user_id" />
  10. <result property="yhfangs" column="yhfangs" />
  11. <result property="yhnum" column="yhnum" />
  12. <result property="name" column="name" />
  13. <result property="shuoming" column="shuoming" />
  14. <result property="tiaojian" column="tiaojian" />
  15. <result property="validity" column="validity" />
  16. <result property="deleted" column="deleted" />
  17. <result property="createTime" column="create_time" />
  18. <result property="updateTime" column="update_time" />
  19. <result property="state" column="state" />
  20. <result property="shId" column="sh_id" />
  21. <result property="spId" column="sp_id" />
  22. <result property="language" column="language" />
  23. <result property="poster" column="poster" />
  24. <!-- 新增字段映射 -->
  25. <result property="type" column="type" />
  26. <result property="code" column="code" />
  27. <result property="orderId" column="order_id" />
  28. <result property="merchantId" column="merchant_id" />
  29. </resultMap>
  30. <sql id="selectVipUserQuanyiVo">
  31. SELECT
  32. id, quanyi_id, user_id, yhfangs, yhnum, name,
  33. shuoming, tiaojian, validity, deleted, create_time,
  34. update_time, state, sh_id, sp_id, language, poster,
  35. type, code,order_id,merchant_id
  36. FROM vip_user_quanyi
  37. </sql>
  38. <select id="selectVipUserQuanyiList" parameterType="VipUserQuanyi" resultMap="VipUserQuanyiResult">
  39. <include refid="selectVipUserQuanyiVo"/>
  40. <where>
  41. <if test="yhfangs != null"> AND yhfangs = #{yhfangs}</if>
  42. <if test="yhnum != null"> AND yhnum = #{yhnum}</if>
  43. <if test="quanyiId != null"> AND quanyi_id = #{quanyiId}</if>
  44. <if test="userId != null"> AND user_id = #{userId}</if>
  45. <if test="name != null and name != ''"> AND name LIKE CONCAT('%', #{name}, '%')</if>
  46. <if test="shuoming != null and shuoming != ''"> AND shuoming = #{shuoming}</if>
  47. <if test="tiaojian != null"> AND tiaojian = #{tiaojian}</if>
  48. <if test="validity != null"> AND validity = #{validity}</if>
  49. <if test="deleted != null and deleted != ''"> AND deleted = #{deleted}</if>
  50. <if test="state != null and state != ''"> AND state = #{state}</if>
  51. <if test="shId != null"> AND sh_id = #{shId}</if>
  52. <if test="spId != null"> AND sp_id = #{spId}</if>
  53. <if test="language != null and language != ''"> AND language = #{language}</if>
  54. <if test="poster != null and poster != ''"> AND poster = #{poster}</if>
  55. <!-- 新增查询条件 -->
  56. <if test="type != null and type != ''"> AND type = #{type}</if>
  57. <if test="code != null and code != ''"> AND code = #{code}</if>
  58. <if test="orderId != null and orderId != ''"> AND order_id = #{orderId}</if>
  59. <if test="merchantId != null and merchantId != ''"> AND merchant_id = #{merchantId}</if>
  60. </where>
  61. </select>
  62. <insert id="insertVipUserQuanyi" parameterType="VipUserQuanyi" useGeneratedKeys="true" keyProperty="id">
  63. INSERT INTO vip_user_quanyi
  64. <trim prefix="(" suffix=")" suffixOverrides=",">
  65. <!-- 原有字段 -->
  66. <if test="yhfangs != null">yhfangs,</if>
  67. <if test="yhnum != null">yhnum,</if>
  68. <if test="quanyiId != null">quanyi_id,</if>
  69. <if test="userId != null">user_id,</if>
  70. <if test="name != null">name,</if>
  71. <if test="shuoming != null">shuoming,</if>
  72. <if test="tiaojian != null">tiaojian,</if>
  73. <if test="validity != null">validity,</if>
  74. <if test="deleted != null">deleted,</if>
  75. <if test="createTime != null">create_time,</if>
  76. <if test="updateTime != null">update_time,</if>
  77. <if test="state != null">state,</if>
  78. <if test="shId != null">sh_id,</if>
  79. <if test="spId != null">sp_id,</if>
  80. <if test="language != null">language,</if>
  81. <if test="poster != null">poster,</if>
  82. <!-- 新增字段 -->
  83. <if test="type != null">type,</if>
  84. <if test="code != null">code,</if>
  85. <if test="orderId != null">order_id,</if>
  86. <if test="merchantId != null">merchant_id,</if>
  87. </trim>
  88. <trim prefix="VALUES (" suffix=")" suffixOverrides=",">
  89. <!-- 原有字段 -->
  90. <if test="yhfangs != null">#{yhfangs},</if>
  91. <if test="yhnum != null">#{yhnum},</if>
  92. <if test="quanyiId != null">#{quanyiId},</if>
  93. <if test="userId != null">#{userId},</if>
  94. <if test="name != null">#{name},</if>
  95. <if test="shuoming != null">#{shuoming},</if>
  96. <if test="tiaojian != null">#{tiaojian},</if>
  97. <if test="validity != null">#{validity},</if>
  98. <if test="deleted != null">#{deleted},</if>
  99. <if test="createTime != null">#{createTime},</if>
  100. <if test="updateTime != null">#{updateTime},</if>
  101. <if test="state != null">#{state},</if>
  102. <if test="shId != null">#{shId},</if>
  103. <if test="spId != null">#{spId},</if>
  104. <if test="language != null">#{language},</if>
  105. <if test="poster != null">#{poster},</if>
  106. <!-- 新增字段 -->
  107. <if test="type != null">#{type},</if>
  108. <if test="code != null">#{code},</if>
  109. <if test="orderId != null">#{orderId},</if>
  110. <if test="merchantId != null">#{merchantId},</if>
  111. </trim>
  112. </insert>
  113. <update id="updateVipUserQuanyi" parameterType="VipUserQuanyi">
  114. UPDATE vip_user_quanyi
  115. <trim prefix="SET" suffixOverrides=",">
  116. <!-- 原有字段 -->
  117. <if test="yhfangs != null">yhfangs = #{yhfangs},</if>
  118. <if test="yhnum != null">yhnum = #{yhnum},</if>
  119. <if test="quanyiId != null">quanyi_id = #{quanyiId},</if>
  120. <if test="userId != null">user_id = #{userId},</if>
  121. <if test="name != null">name = #{name},</if>
  122. <if test="shuoming != null">shuoming = #{shuoming},</if>
  123. <if test="tiaojian != null">tiaojian = #{tiaojian},</if>
  124. <if test="validity != null">validity = #{validity},</if>
  125. <if test="deleted != null">deleted = #{deleted},</if>
  126. <if test="createTime != null">create_time = #{createTime},</if>
  127. <if test="updateTime != null">update_time = #{updateTime},</if>
  128. <if test="state != null">state = #{state},</if>
  129. <if test="shId != null">sh_id = #{shId},</if>
  130. <if test="spId != null">sp_id = #{spId},</if>
  131. <if test="language != null">language = #{language},</if>
  132. <if test="poster != null">poster = #{poster},</if>
  133. <!-- 新增字段 -->
  134. <if test="type != null">type = #{type},</if>
  135. <if test="code != null">code = #{code},</if>
  136. <if test="orderId != null">order_id = #{orderId},</if>
  137. <if test="merchantId != null">merchant_id = #{merchantId},</if>
  138. </trim>
  139. WHERE id = #{id}
  140. </update>
  141. <delete id="deleteVipUserQuanyiById" parameterType="Long">
  142. delete from vip_user_quanyi where id = #{id}
  143. </delete>
  144. <delete id="deleteVipUserQuanyiByIds" parameterType="String">
  145. delete from vip_user_quanyi where id in
  146. <foreach item="id" collection="array" open="(" separator="," close=")">
  147. #{id}
  148. </foreach>
  149. </delete>
  150. </mapper>