Guest User

Untitled

a guest
Jan 21st, 2019
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.12 KB | None | 0 0
  1. // Set up the map object for the back end
  2. Map<Integer, String> posMap = new HashMap<Integer, String>();
  3. // Get the approved mailers
  4. String[] mailerList = request.getParameterValues("approved");
  5. if (mailerList != null && mailerList.length > 0)
  6. {
  7. for(String mailer : mailerList)
  8. {
  9. posMap.put(Integer.parseInt(mailer), "Y");
  10. }
  11. }
  12. // reset the mailerList
  13. mailerList = null;
  14. // get the ignored mailers
  15. mailerList = request.getParameterValues("ignored");
  16. if (mailerList != null && mailerList.length > 0)
  17. {
  18. for(String mailer : mailerList)
  19. {
  20. posSampleMap.put(Integer.parseInt(mailer), "N");
  21. }
  22. }
  23. // only update POS if the map is not empty
  24. if(!posMap.isEmpty())
  25. {
  26. updateMapper.updatePOSSampling(posMap);
  27. }
  28.  
  29. <update id="updatePOSSampling" parameterType="hashmap">
  30. UPDATE <table_name>
  31. SET sampling_enabled = ${myMapValue}
  32. WHERE mailer_name = ${myMapKey}
  33. </update>
Add Comment
Please, Sign In to add comment