package com.xcgl.weixin.dao; import java.util.List; import java.util.Map; import org.jeecgframework.minidao.annotation.MiniDao; import org.jeecgframework.minidao.annotation.Param; import org.jeecgframework.minidao.annotation.Sql; import org.jeecgframework.web.system.pojo.base.TSUser; import org.springframework.stereotype.Repository; import com.xcgl.projecttask.entity.ProjecttaskEntity; import com.xcgl.taskresult.entity.TaskResultEntity; import com.xcgl.weixin.entity.AuthorityDto; import com.xcgl.weixin.entity.SensorLiveDto; import com.xcgl.weixin.entity.UserAccessoryDto; import com.xcgl.weixin.entity.UserDto; import cn.com.lzt.warehouse.entity.WarehouseEntity; @Repository @MiniDao public interface WXDao { public UserDto getUser(@Param("openid") String openid); public List getAuthByOpenid(@Param("openid") String openid); public List getTaskListAll(@Param("openid") String openid,@Param("qrydate") String qrydate,@Param("projectid") String projectid, @Param("taskid") String taskid); public List getTaskListDone(@Param("openid") String openid,@Param("qrydate") String qrydate,@Param("projectid") String projectid, @Param("taskid") String taskid); //outdata 逾期 public List getTaskListNotDone(@Param("openid") String openid,@Param("qrydate") String qrydate,@Param("projectid") String projectid, @Param("taskid") String taskid,@Param("outDate") String outDate); public List getSensorLiveData(@Param("qrydate") String qrydate,@Param("projectid") String projectid); public List getProjectUsers(@Param("projectid") String projectid); public List getUserAccessory(@Param("userid") String userid); public List> getTodayWorkStati(@Param("projectid") String projectid,@Param("qrydate") String qrydate); public List> getWeekWorkStati(@Param("projectid") String projectid,@Param("today") String today,@Param("laseweekday") String laseweekday); public List> getDeviceStatusSumData(@Param("projectid") String projectid,@Param("qrydate") String qrydate); public List> getTodayWork4PushMsg(@Param("today") String today); public TaskResultEntity getTaskResult(@Param("openid") String openid, @Param("taskid") String taskid); public List> getTaskStati(@Param("openid") String openid, @Param("projectid") String projectid , @Param("today") String today , @Param("weekstart") String weekstart , @Param("weekend") String weekend , @Param("monthstart") String monthstart , @Param("monthend") String monthend); @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)") public List getNotSubmitOnhandReportWarehouseList(@Param("yearmonth") String yearmonth); /** * 按人员角色 查询用户,只查询有openid 的人员 * */ @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") public List> getXZBFJLUsers(@Param("rolecode") String rolecode); /** * 按人员角色 查询用户 * */ @Sql("select user.id as id ,openid,bu.realname as realname,user.usernum as usernum,bu.username as username from t_s_user user " + "left join t_s_base_user bu on bu.id = user.id" + " where user.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)") public List> getUsersByRoleCode(@Param("rolecode") String rolecode); /** * 按人员角色 查询openid不空的用户 * */ @Sql("select user.id as id ,openid,bu.realname as realname,user.usernum as usernum,bu.username as username from t_s_user user " + "left join t_s_base_user bu on bu.id = user.id" + " where user.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 user.openid is not null") public List> getUsersByRoleCodeOpenidNotNull(@Param("rolecode") String rolecode); /** * 查询工资策略未配置或配置错误人员 * */ @Sql("select distinct CONCAT(realname,'(',glcname,')' ) as realName from ( " + "select bu.realname,dept.glcname from t_bus_user_personnel per " + "left join t_s_base_user bu on bu.id = per.userid " + "left join t_s_user_org uorg on uorg.user_id = bu.id and uorg.ifpluralism = '0' " + "left join t_s_depart dept on dept.id = uorg.org_id " + "where leave_date is null and delete_flag = '0' and not exists (select * from t_bus_user_wagestrategy uwage where uwage.userid = per.userid) " + "union all " + "select bu.realname,dept.glcname " + "from t_bus_user_wagestrategy uwage " + "left join t_s_base_user bu on bu.id = uwage.userid " + "left join t_s_user_org uorg on uorg.user_id = bu.id and uorg.ifpluralism = '0' " + "left join t_s_depart dept on dept.id = uorg.org_id " + "left join t_s_depart wdept on wdept.id = uwage.belong_unitid " + "left join t_bus_user_personnel per on per.userid = bu.id " + "where bu.delete_flag = '0' and uwage.belong_unitid <> uorg.org_id and leave_date is null " + ") temp order by glcname") public List getNoWageUserList(); }