TMingProductUserMapper.xml 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  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.bussiness.mapper.TMingProductUserMapper">
  6. <resultMap type="TMingProductUser" id="TMingProductUserResult">
  7. <result property="id" column="id" />
  8. <result property="productId" column="product_id" />
  9. <result property="appUserId" column="app_user_id" />
  10. <result property="pledgeNum" column="pledge_num" />
  11. <result property="createBy" column="create_by" />
  12. <result property="createTime" column="create_time" />
  13. <result property="updateBy" column="update_by" />
  14. <result property="updateTime" column="update_time" />
  15. <result property="searchValue" column="search_value" />
  16. <result property="remark" column="remark" />
  17. <result property="coin" column="coin" />
  18. <result property="icon" column="icon" />
  19. <result property="title" column="title" />
  20. <collection property="tAppUser" ofType="com.ruoyi.bussiness.domain.TAppUser">
  21. <result property="userId" column="user_id" />
  22. <result property="loginName" column="login_name" />
  23. <result property="loginPassword" column="login_password" />
  24. <result property="phone" column="phone" />
  25. <result property="isTest" column="is_test" />
  26. <result property="status" column="status" />
  27. <result property="host" column="host" />
  28. <result property="email" column="email" />
  29. </collection>
  30. </resultMap>
  31. <sql id="selectTMingProductUserVo">
  32. select a.id, a.product_id, a.app_user_id, a.pledge_num, a.create_by, a.create_time, a.update_by, a.update_time,
  33. a.search_value, a.remark,
  34. u.user_id, u.login_name, u.login_password, u.phone, u.is_test, u.status, u.host, u.email,
  35. p.coin, p.icon, p.title
  36. from t_ming_product_user a
  37. left join t_app_user u on u.user_id = a.app_user_id
  38. left join t_ming_product p on p.id = a.product_id
  39. </sql>
  40. <select id="selectTMingProductUserList" parameterType="TMingProductUser" resultMap="TMingProductUserResult">
  41. <include refid="selectTMingProductUserVo"/>
  42. <where>
  43. <if test="productId != null "> and a.product_id = #{productId}</if>
  44. <if test="appUserId != null "> and a.app_user_id = #{appUserId}</if>
  45. <if test="pledgeNum != null "> and a.pledge_num = #{pledgeNum}</if>
  46. <if test="searchValue != null and searchValue != ''"> and a.search_value = #{searchValue}</if>
  47. </where>
  48. order by a.update_time
  49. </select>
  50. <select id="selectTMingProductUserById" parameterType="Long" resultMap="TMingProductUserResult">
  51. <include refid="selectTMingProductUserVo"/>
  52. where id = #{id}
  53. </select>
  54. <insert id="insertTMingProductUser" parameterType="TMingProductUser" useGeneratedKeys="true" keyProperty="id">
  55. insert into t_ming_product_user
  56. <trim prefix="(" suffix=")" suffixOverrides=",">
  57. <if test="productId != null">product_id,</if>
  58. <if test="appUserId != null">app_user_id,</if>
  59. <if test="pledgeNum != null">pledge_num,</if>
  60. <if test="createBy != null">create_by,</if>
  61. <if test="createTime != null">create_time,</if>
  62. <if test="updateBy != null">update_by,</if>
  63. <if test="updateTime != null">update_time,</if>
  64. <if test="searchValue != null">search_value,</if>
  65. <if test="remark != null">remark,</if>
  66. </trim>
  67. <trim prefix="values (" suffix=")" suffixOverrides=",">
  68. <if test="productId != null">#{productId},</if>
  69. <if test="appUserId != null">#{appUserId},</if>
  70. <if test="pledgeNum != null">#{pledgeNum},</if>
  71. <if test="createBy != null">#{createBy},</if>
  72. <if test="createTime != null">#{createTime},</if>
  73. <if test="updateBy != null">#{updateBy},</if>
  74. <if test="updateTime != null">#{updateTime},</if>
  75. <if test="searchValue != null">#{searchValue},</if>
  76. <if test="remark != null">#{remark},</if>
  77. </trim>
  78. </insert>
  79. <update id="updateTMingProductUser" parameterType="TMingProductUser">
  80. update t_ming_product_user
  81. <trim prefix="SET" suffixOverrides=",">
  82. <if test="productId != null">product_id = #{productId},</if>
  83. <if test="appUserId != null">app_user_id = #{appUserId},</if>
  84. <if test="pledgeNum != null">pledge_num = #{pledgeNum},</if>
  85. <if test="createBy != null">create_by = #{createBy},</if>
  86. <if test="createTime != null">create_time = #{createTime},</if>
  87. <if test="updateBy != null">update_by = #{updateBy},</if>
  88. <if test="updateTime != null">update_time = #{updateTime},</if>
  89. <if test="searchValue != null">search_value = #{searchValue},</if>
  90. <if test="remark != null">remark = #{remark},</if>
  91. </trim>
  92. where id = #{id}
  93. </update>
  94. <delete id="deleteTMingProductUserById" parameterType="Long">
  95. delete from t_ming_product_user where id = #{id}
  96. </delete>
  97. <delete id="deleteTMingProductUserByIds" parameterType="String">
  98. delete from t_ming_product_user where id in
  99. <foreach item="id" collection="array" open="(" separator="," close=")">
  100. #{id}
  101. </foreach>
  102. </delete>
  103. </mapper>