GroupBuyBatchServiceDaoImplMapper.xml 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  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="groupBuyBatchServiceDaoImpl">
  6. <!-- 保存拼团批次信息 add by wuxw 2018-07-03 -->
  7. <insert id="saveGroupBuyBatchInfo" parameterType="Map">
  8. insert into group_buy_batch(
  9. batch_end_time,batch_id,store_id,setting_id,batch_start_time,cur_batch
  10. ) values (
  11. #{batchEndTime},#{batchId},#{storeId},#{settingId},#{batchStartTime},#{curBatch}
  12. )
  13. </insert>
  14. <!-- 查询拼团批次信息 add by wuxw 2018-07-03 -->
  15. <select id="getGroupBuyBatchInfo" parameterType="Map" resultType="Map">
  16. select t.batch_end_time,t.batch_end_time batchEndTime,t.status_cd,t.status_cd statusCd,t.batch_id,t.batch_id batchId,t.store_id,t.store_id storeId,t.setting_id,t.setting_id settingId,t.batch_start_time,t.batch_start_time batchStartTime,t.cur_batch,t.cur_batch curBatch
  17. from group_buy_batch t
  18. where 1 =1
  19. <if test="batchEndTime !=null and batchEndTime != ''">
  20. and t.batch_end_time= #{batchEndTime}
  21. </if>
  22. <if test="statusCd !=null and statusCd != ''">
  23. and t.status_cd= #{statusCd}
  24. </if>
  25. <if test="batchId !=null and batchId != ''">
  26. and t.batch_id= #{batchId}
  27. </if>
  28. <if test="storeId !=null and storeId != ''">
  29. and t.store_id= #{storeId}
  30. </if>
  31. <if test="settingId !=null and settingId != ''">
  32. and t.setting_id= #{settingId}
  33. </if>
  34. <if test="batchStartTime !=null and batchStartTime != ''">
  35. and t.batch_start_time= #{batchStartTime}
  36. </if>
  37. <if test="curBatch !=null and curBatch != ''">
  38. and t.cur_batch= #{curBatch}
  39. </if>
  40. order by t.create_time desc
  41. <if test="page != -1 and page != null ">
  42. limit #{page}, #{row}
  43. </if>
  44. </select>
  45. <!-- 修改拼团批次信息 add by wuxw 2018-07-03 -->
  46. <update id="updateGroupBuyBatchInfo" parameterType="Map">
  47. update group_buy_batch t set t.status_cd = #{statusCd}
  48. <if test="newBId != null and newBId != ''">
  49. ,t.b_id = #{newBId}
  50. </if>
  51. <if test="batchEndTime !=null and batchEndTime != ''">
  52. , t.batch_end_time= #{batchEndTime}
  53. </if>
  54. <if test="storeId !=null and storeId != ''">
  55. , t.store_id= #{storeId}
  56. </if>
  57. <if test="settingId !=null and settingId != ''">
  58. , t.setting_id= #{settingId}
  59. </if>
  60. <if test="batchStartTime !=null and batchStartTime != ''">
  61. , t.batch_start_time= #{batchStartTime}
  62. </if>
  63. <if test="curBatch !=null and curBatch != ''">
  64. , t.cur_batch= #{curBatch}
  65. </if>
  66. where 1=1 <if test="batchId !=null and batchId != ''">
  67. and t.batch_id= #{batchId}
  68. </if>
  69. </update>
  70. <!-- 查询拼团批次数量 add by wuxw 2018-07-03 -->
  71. <select id="queryGroupBuyBatchsCount" parameterType="Map" resultType="Map">
  72. select count(1) count
  73. from group_buy_batch t
  74. where 1 =1
  75. <if test="batchEndTime !=null and batchEndTime != ''">
  76. and t.batch_end_time= #{batchEndTime}
  77. </if>
  78. <if test="statusCd !=null and statusCd != ''">
  79. and t.status_cd= #{statusCd}
  80. </if>
  81. <if test="batchId !=null and batchId != ''">
  82. and t.batch_id= #{batchId}
  83. </if>
  84. <if test="storeId !=null and storeId != ''">
  85. and t.store_id= #{storeId}
  86. </if>
  87. <if test="settingId !=null and settingId != ''">
  88. and t.setting_id= #{settingId}
  89. </if>
  90. <if test="batchStartTime !=null and batchStartTime != ''">
  91. and t.batch_start_time= #{batchStartTime}
  92. </if>
  93. <if test="curBatch !=null and curBatch != ''">
  94. and t.cur_batch= #{curBatch}
  95. </if>
  96. </select>
  97. </mapper>