CouponUserDetailV1ServiceDaoImplMapper.xml 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  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="couponUserDetailV1ServiceDaoImpl">
  6. <!-- 保存用户抵消记录信息 add by wuxw 2018-07-03 -->
  7. <insert id="saveCouponUserDetailInfo" parameterType="Map">
  8. insert into coupon_user_detail(
  9. coupon_name,uo_id,obj_id,coupon_id,user_name,user_id,obj_type
  10. ) values (
  11. #{couponName},#{uoId},#{objId},#{couponId},#{userName},#{userId},#{objType}
  12. )
  13. </insert>
  14. <!-- 查询用户抵消记录信息 add by wuxw 2018-07-03 -->
  15. <select id="getCouponUserDetailInfo" parameterType="Map" resultType="Map">
  16. select t.coupon_name,t.coupon_name couponName,t.uo_id,t.uo_id uoId,t.obj_id,t.obj_id
  17. objId,t.status_cd,t.status_cd statusCd,t.coupon_id,t.coupon_id couponId,t.user_name,t.user_name
  18. userName,t.user_id,t.user_id userId,t.obj_type,t.obj_type objType
  19. from coupon_user_detail t
  20. where 1 =1
  21. <if test="couponName !=null and couponName != ''">
  22. and t.coupon_name= #{couponName}
  23. </if>
  24. <if test="uoId !=null and uoId != ''">
  25. and t.uo_id= #{uoId}
  26. </if>
  27. <if test="objId !=null and objId != ''">
  28. and t.obj_id= #{objId}
  29. </if>
  30. <if test="statusCd !=null and statusCd != ''">
  31. and t.status_cd= #{statusCd}
  32. </if>
  33. <if test="couponId !=null and couponId != ''">
  34. and t.coupon_id= #{couponId}
  35. </if>
  36. <if test="userName !=null and userName != ''">
  37. and t.user_name= #{userName}
  38. </if>
  39. <if test="userId !=null and userId != ''">
  40. and t.user_id= #{userId}
  41. </if>
  42. <if test="objType !=null and objType != ''">
  43. and t.obj_type= #{objType}
  44. </if>
  45. order by t.create_time desc
  46. <if test="page != -1 and page != null ">
  47. limit #{page}, #{row}
  48. </if>
  49. </select>
  50. <!-- 修改用户抵消记录信息 add by wuxw 2018-07-03 -->
  51. <update id="updateCouponUserDetailInfo" parameterType="Map">
  52. update coupon_user_detail t set t.status_cd = #{statusCd}
  53. <if test="newBId != null and newBId != ''">
  54. ,t.b_id = #{newBId}
  55. </if>
  56. <if test="couponName !=null and couponName != ''">
  57. , t.coupon_name= #{couponName}
  58. </if>
  59. <if test="objId !=null and objId != ''">
  60. , t.obj_id= #{objId}
  61. </if>
  62. <if test="couponId !=null and couponId != ''">
  63. , t.coupon_id= #{couponId}
  64. </if>
  65. <if test="userName !=null and userName != ''">
  66. , t.user_name= #{userName}
  67. </if>
  68. <if test="userId !=null and userId != ''">
  69. , t.user_id= #{userId}
  70. </if>
  71. <if test="objType !=null and objType != ''">
  72. , t.obj_type= #{objType}
  73. </if>
  74. where 1=1
  75. <if test="uoId !=null and uoId != ''">
  76. and t.uo_id= #{uoId}
  77. </if>
  78. </update>
  79. <!-- 查询用户抵消记录数量 add by wuxw 2018-07-03 -->
  80. <select id="queryCouponUserDetailsCount" parameterType="Map" resultType="Map">
  81. select count(1) count
  82. from coupon_user_detail t
  83. where 1 =1
  84. <if test="couponName !=null and couponName != ''">
  85. and t.coupon_name= #{couponName}
  86. </if>
  87. <if test="uoId !=null and uoId != ''">
  88. and t.uo_id= #{uoId}
  89. </if>
  90. <if test="objId !=null and objId != ''">
  91. and t.obj_id= #{objId}
  92. </if>
  93. <if test="statusCd !=null and statusCd != ''">
  94. and t.status_cd= #{statusCd}
  95. </if>
  96. <if test="couponId !=null and couponId != ''">
  97. and t.coupon_id= #{couponId}
  98. </if>
  99. <if test="userName !=null and userName != ''">
  100. and t.user_name= #{userName}
  101. </if>
  102. <if test="userId !=null and userId != ''">
  103. and t.user_id= #{userId}
  104. </if>
  105. <if test="objType !=null and objType != ''">
  106. and t.obj_type= #{objType}
  107. </if>
  108. </select>
  109. </mapper>