WXDao.java 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. package com.xcgl.weixin.dao;
  2. import java.util.List;
  3. import java.util.Map;
  4. import org.jeecgframework.minidao.annotation.MiniDao;
  5. import org.jeecgframework.minidao.annotation.Param;
  6. import org.jeecgframework.minidao.annotation.Sql;
  7. import org.jeecgframework.web.system.pojo.base.TSUser;
  8. import org.springframework.stereotype.Repository;
  9. import com.xcgl.projecttask.entity.ProjecttaskEntity;
  10. import com.xcgl.taskresult.entity.TaskResultEntity;
  11. import com.xcgl.weixin.entity.AuthorityDto;
  12. import com.xcgl.weixin.entity.SensorLiveDto;
  13. import com.xcgl.weixin.entity.UserAccessoryDto;
  14. import com.xcgl.weixin.entity.UserDto;
  15. import cn.com.lzt.warehouse.entity.WarehouseEntity;
  16. @Repository
  17. @MiniDao
  18. public interface WXDao {
  19. public UserDto getUser(@Param("openid") String openid);
  20. public List<AuthorityDto> getAuthByOpenid(@Param("openid") String openid);
  21. public List<ProjecttaskEntity> getTaskListAll(@Param("openid") String openid,@Param("qrydate") String qrydate,@Param("projectid") String projectid,
  22. @Param("taskid") String taskid);
  23. public List<ProjecttaskEntity> getTaskListDone(@Param("openid") String openid,@Param("qrydate") String qrydate,@Param("projectid") String projectid,
  24. @Param("taskid") String taskid);
  25. //outdata 逾期
  26. public List<ProjecttaskEntity> getTaskListNotDone(@Param("openid") String openid,@Param("qrydate") String qrydate,@Param("projectid") String projectid,
  27. @Param("taskid") String taskid,@Param("outDate") String outDate);
  28. public List<SensorLiveDto> getSensorLiveData(@Param("qrydate") String qrydate,@Param("projectid") String projectid);
  29. public List<UserDto> getProjectUsers(@Param("projectid") String projectid);
  30. public List<UserAccessoryDto> getUserAccessory(@Param("userid") String userid);
  31. public List<Map<String,Object>> getTodayWorkStati(@Param("projectid") String projectid,@Param("qrydate") String qrydate);
  32. public List<Map<String,Object>> getWeekWorkStati(@Param("projectid") String projectid,@Param("today") String today,@Param("laseweekday") String laseweekday);
  33. public List<Map<String,Object>> getDeviceStatusSumData(@Param("projectid") String projectid,@Param("qrydate") String qrydate);
  34. public List<Map<String,Object>> getTodayWork4PushMsg(@Param("today") String today);
  35. public TaskResultEntity getTaskResult(@Param("openid") String openid, @Param("taskid") String taskid);
  36. public List<Map<String,String>> getTaskStati(@Param("openid") String openid, @Param("projectid") String projectid
  37. , @Param("today") String today
  38. , @Param("weekstart") String weekstart
  39. , @Param("weekend") String weekend
  40. , @Param("monthstart") String monthstart
  41. , @Param("monthend") String monthend);
  42. @Sql("select warehouse_name as warehouseName from t_b_warehouse where id not in(select warehouse_id from t_b_orders where order_months = :yearmonth)")
  43. public List<WarehouseEntity> getNotSubmitOnhandReportWarehouseList(@Param("yearmonth") String yearmonth);
  44. /**
  45. * 按人员角色 查询用户,只查询有openid 的人员
  46. * */
  47. @Sql("select id,openid from t_s_user where id in (select roleuser.userid from t_s_role_user roleuser left join t_s_role role on roleuser.roleid = role.id where role.rolecode = :rolecode) and openid is not null")
  48. public List<Map<String,Object>> getXZBFJLUsers(@Param("rolecode") String rolecode);
  49. /**
  50. * 按人员角色 查询用户
  51. * */
  52. @Sql("select user.id as id ,openid,bu.realname as realname,user.usernum as usernum,bu.username as username from t_s_user user "
  53. + "left join t_s_base_user bu on bu.id = user.id"
  54. + " where user.id in (select roleuser.userid from t_s_role_user roleuser "
  55. + "left join t_s_role role on roleuser.roleid = role.id "
  56. + "where role.rolecode = :rolecode)")
  57. public List<Map<String,Object>> getUsersByRoleCode(@Param("rolecode") String rolecode);
  58. /**
  59. * 按人员角色 查询openid不空的用户
  60. * */
  61. @Sql("select user.id as id ,openid,bu.realname as realname,user.usernum as usernum,bu.username as username from t_s_user user "
  62. + "left join t_s_base_user bu on bu.id = user.id"
  63. + " where user.id in (select roleuser.userid from t_s_role_user roleuser "
  64. + "left join t_s_role role on roleuser.roleid = role.id "
  65. + "where role.rolecode = :rolecode ) and user.openid is not null")
  66. public List<Map<String,Object>> getUsersByRoleCodeOpenidNotNull(@Param("rolecode") String rolecode);
  67. /**
  68. * 查询工资策略未配置或配置错误人员
  69. * */
  70. @Sql("select distinct CONCAT(realname,'(',glcname,')' ) as realName from ( "
  71. + "select bu.realname,dept.glcname from t_bus_user_personnel per "
  72. + "left join t_s_base_user bu on bu.id = per.userid "
  73. + "left join t_s_user_org uorg on uorg.user_id = bu.id and uorg.ifpluralism = '0' "
  74. + "left join t_s_depart dept on dept.id = uorg.org_id "
  75. + "where leave_date is null and delete_flag = '0' and not exists (select * from t_bus_user_wagestrategy uwage where uwage.userid = per.userid) "
  76. + "union all "
  77. + "select bu.realname,dept.glcname "
  78. + "from t_bus_user_wagestrategy uwage "
  79. + "left join t_s_base_user bu on bu.id = uwage.userid "
  80. + "left join t_s_user_org uorg on uorg.user_id = bu.id and uorg.ifpluralism = '0' "
  81. + "left join t_s_depart dept on dept.id = uorg.org_id "
  82. + "left join t_s_depart wdept on wdept.id = uwage.belong_unitid "
  83. + "left join t_bus_user_personnel per on per.userid = bu.id "
  84. + "where bu.delete_flag = '0' and uwage.belong_unitid <> uorg.org_id and leave_date is null "
  85. + ") temp order by glcname")
  86. public List<TSUser> getNoWageUserList();
  87. }