ActivitiesBeautifulStaffServiceDaoImplMapper.xml 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  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="activitiesBeautifulStaffServiceDaoImpl">
  6. <!-- 保存活动规则信息 add by wuxw 2018-07-03 -->
  7. <insert id="saveActivitiesBeautifulStaffInfo" parameterType="Map">
  8. insert into activities_beautiful_staff(
  9. be_id,work_content,activities_num,poll,rule_id,store_id,staff_id
  10. ) values (
  11. #{beId},#{workContent},#{activitiesNum},#{poll},#{ruleId},#{storeId},#{staffId}
  12. )
  13. </insert>
  14. <!-- 查询活动规则信息 add by wuxw 2018-07-03 -->
  15. <select id="getActivitiesBeautifulStaffInfo" parameterType="Map" resultType="Map">
  16. select t.be_id,t.be_id beId,t.work_content,t.work_content workContent,t.activities_num,t.activities_num
  17. activitiesNum,t.status_cd,t.status_cd statusCd,t.poll,t.rule_id,t.rule_id ruleId,t.store_id,t.store_id
  18. storeId,t.staff_id,t.staff_id staffId,uu.name staffName,ar.rule_name ruleName,t.create_time createTime
  19. from activities_beautiful_staff t
  20. left join u_user uu on t.staff_id = uu.user_id and uu.status_cd = '0'
  21. left join activities_rule ar on t.rule_id = ar.rule_id and ar.status_cd = '0' and ar.obj_type = '3307' and
  22. ar.obj_id = t.store_id
  23. where 1 =1
  24. <if test="beId !=null and beId != ''">
  25. and t.be_id= #{beId}
  26. </if>
  27. <if test="workContent !=null and workContent != ''">
  28. and t.work_content= #{workContent}
  29. </if>
  30. <if test="activitiesNum !=null and activitiesNum != ''">
  31. and t.activities_num= #{activitiesNum}
  32. </if>
  33. <if test="statusCd !=null and statusCd != ''">
  34. and t.status_cd= #{statusCd}
  35. </if>
  36. <if test="poll !=null and poll != ''">
  37. and t.poll= #{poll}
  38. </if>
  39. <if test="ruleId !=null and ruleId != ''">
  40. and t.rule_id= #{ruleId}
  41. </if>
  42. <if test="storeId !=null and storeId != ''">
  43. and t.store_id= #{storeId}
  44. </if>
  45. <if test="staffId !=null and staffId != ''">
  46. and t.staff_id= #{staffId}
  47. </if>
  48. order by t.create_time desc
  49. <if test="page != -1 and page != null ">
  50. limit #{page}, #{row}
  51. </if>
  52. </select>
  53. <!-- 修改活动规则信息 add by wuxw 2018-07-03 -->
  54. <update id="updateActivitiesBeautifulStaffInfo" parameterType="Map">
  55. update activities_beautiful_staff t set t.status_cd = #{statusCd}
  56. <if test="newBId != null and newBId != ''">
  57. ,t.b_id = #{newBId}
  58. </if>
  59. <if test="workContent !=null and workContent != ''">
  60. , t.work_content= #{workContent}
  61. </if>
  62. <if test="activitiesNum !=null and activitiesNum != ''">
  63. , t.activities_num= #{activitiesNum}
  64. </if>
  65. <if test="poll !=null and poll != ''">
  66. , t.poll= #{poll}
  67. </if>
  68. <if test="ruleId !=null and ruleId != ''">
  69. , t.rule_id= #{ruleId}
  70. </if>
  71. <if test="storeId !=null and storeId != ''">
  72. , t.store_id= #{storeId}
  73. </if>
  74. <if test="staffId !=null and staffId != ''">
  75. , t.staff_id= #{staffId}
  76. </if>
  77. where 1=1
  78. <if test="beId !=null and beId != ''">
  79. and t.be_id= #{beId}
  80. </if>
  81. </update>
  82. <!-- 查询活动规则数量 add by wuxw 2018-07-03 -->
  83. <select id="queryActivitiesBeautifulStaffsCount" parameterType="Map" resultType="Map">
  84. select count(1) count
  85. from activities_beautiful_staff t
  86. where 1 =1
  87. <if test="beId !=null and beId != ''">
  88. and t.be_id= #{beId}
  89. </if>
  90. <if test="workContent !=null and workContent != ''">
  91. and t.work_content= #{workContent}
  92. </if>
  93. <if test="activitiesNum !=null and activitiesNum != ''">
  94. and t.activities_num= #{activitiesNum}
  95. </if>
  96. <if test="statusCd !=null and statusCd != ''">
  97. and t.status_cd= #{statusCd}
  98. </if>
  99. <if test="poll !=null and poll != ''">
  100. and t.poll= #{poll}
  101. </if>
  102. <if test="ruleId !=null and ruleId != ''">
  103. and t.rule_id= #{ruleId}
  104. </if>
  105. <if test="storeId !=null and storeId != ''">
  106. and t.store_id= #{storeId}
  107. </if>
  108. <if test="staffId !=null and staffId != ''">
  109. and t.staff_id= #{staffId}
  110. </if>
  111. </select>
  112. </mapper>