MarketRuleWayV1ServiceDaoImplMapper.xml 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  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="marketRuleWayV1ServiceDaoImpl">
  6. <!-- 保存营销规则方式信息 add by wuxw 2018-07-03 -->
  7. <insert id="saveMarketRuleWayInfo" parameterType="Map">
  8. insert into market_rule_way(
  9. way_id,way_type,way_obj_id,remark,rule_id
  10. ) values (
  11. #{wayId},#{wayType},#{wayObjId},#{remark},#{ruleId}
  12. )
  13. </insert>
  14. <!-- 查询营销规则方式信息 add by wuxw 2018-07-03 -->
  15. <select id="getMarketRuleWayInfo" parameterType="Map" resultType="Map">
  16. select t.way_id,t.way_id wayId,t.way_type,t.way_type wayType,t.way_obj_id,t.way_obj_id
  17. wayObjId,t.status_cd,t.status_cd statusCd,t.remark,t.rule_id,t.rule_id ruleId,
  18. mt.name textName,mp.`name` picName,mg.name goodsName,td.`name` wayTypeName
  19. from market_rule_way t
  20. left join market_text mt on t.way_obj_id = mt.text_id and t.way_type = '1001' and mt.status_cd = '0'
  21. left join market_pic mp on t.way_obj_id = mp.pic_id and t.way_type = '2002' and mp.status_cd = '0'
  22. left join market_goods mg on t.way_obj_id = mg.goods_id and t.way_type = '3003' and mg.status_cd = '0'
  23. left join t_dict td on t.way_type = td.status_cd and td.table_name = 'market_rule_way' and td.table_columns = 'way_type'
  24. where 1 =1
  25. <if test="wayId !=null and wayId != ''">
  26. and t.way_id= #{wayId}
  27. </if>
  28. <if test="wayType !=null and wayType != ''">
  29. and t.way_type= #{wayType}
  30. </if>
  31. <if test="wayObjId !=null and wayObjId != ''">
  32. and t.way_obj_id= #{wayObjId}
  33. </if>
  34. <if test="statusCd !=null and statusCd != ''">
  35. and t.status_cd= #{statusCd}
  36. </if>
  37. <if test="remark !=null and remark != ''">
  38. and t.remark= #{remark}
  39. </if>
  40. <if test="ruleId !=null and ruleId != ''">
  41. and t.rule_id= #{ruleId}
  42. </if>
  43. order by t.create_time desc
  44. <if test="page != -1 and page != null ">
  45. limit #{page}, #{row}
  46. </if>
  47. </select>
  48. <!-- 修改营销规则方式信息 add by wuxw 2018-07-03 -->
  49. <update id="updateMarketRuleWayInfo" parameterType="Map">
  50. update market_rule_way t set t.status_cd = #{statusCd}
  51. <if test="newBId != null and newBId != ''">
  52. ,t.b_id = #{newBId}
  53. </if>
  54. <if test="wayType !=null and wayType != ''">
  55. , t.way_type= #{wayType}
  56. </if>
  57. <if test="wayObjId !=null and wayObjId != ''">
  58. , t.way_obj_id= #{wayObjId}
  59. </if>
  60. <if test="remark !=null and remark != ''">
  61. , t.remark= #{remark}
  62. </if>
  63. <if test="ruleId !=null and ruleId != ''">
  64. , t.rule_id= #{ruleId}
  65. </if>
  66. where 1=1
  67. <if test="wayId !=null and wayId != ''">
  68. and t.way_id= #{wayId}
  69. </if>
  70. </update>
  71. <!-- 查询营销规则方式数量 add by wuxw 2018-07-03 -->
  72. <select id="queryMarketRuleWaysCount" parameterType="Map" resultType="Map">
  73. select count(1) count
  74. from market_rule_way t
  75. where 1 =1
  76. <if test="wayId !=null and wayId != ''">
  77. and t.way_id= #{wayId}
  78. </if>
  79. <if test="wayType !=null and wayType != ''">
  80. and t.way_type= #{wayType}
  81. </if>
  82. <if test="wayObjId !=null and wayObjId != ''">
  83. and t.way_obj_id= #{wayObjId}
  84. </if>
  85. <if test="statusCd !=null and statusCd != ''">
  86. and t.status_cd= #{statusCd}
  87. </if>
  88. <if test="remark !=null and remark != ''">
  89. and t.remark= #{remark}
  90. </if>
  91. <if test="ruleId !=null and ruleId != ''">
  92. and t.rule_id= #{ruleId}
  93. </if>
  94. </select>
  95. </mapper>