ActivitiesBeautifulStaffServiceDaoImplMapper.xml 4.5 KB

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