package cn.com.capcloud.api.action.myself.system.data;

import javax.annotation.PostConstruct;
import org.springframework.beans.factory.annotation.Autowired;
import javax.servlet.http.HttpServletRequest;


import cn.com.capcloud.api.action.service.ApiService;
import cn.com.capcloud.ccui.core.common.json.JackJSONObject;
import cn.com.capcloud.core.noentitydb.BaseService;
import org.springframework.stereotype.Component;

import cn.com.capcloud.core.noentitydb.DefaultAction;
import cn.com.capcloud.core.system.user.User;
import cn.com.capcloud.core.system.user.UserService;

@Component
public class DataTodoAction extends DefaultAction{
	@Autowired
	private BaseService baseService;
	@Autowired
	private UserService userService;
	@Autowired
	private ApiService apiService;
	private static DataTodoAction action;
	@PostConstruct
	public void init(){
		action=this;
		action.baseService=this.baseService;
		action.userService=this.userService;
		action.apiService =this.apiService;
	}
	//待办
	public String buildSqlByDaiBan(String jsonStr, JackJSONObject retJson, HttpServletRequest request) {
		User user=action.userService.getUser(request);
		String sql="select * from tbl_data_todo where todo_status='N' and status='0' and to_user_id="+user.getId();
		return sql;
	}
	//已办
	public String buildSqlByYiBan(String jsonStr, JackJSONObject retJson, HttpServletRequest request) {
		User user=action.userService.getUser(request);
		String sql="select * from tbl_data_todo where todo_status='Y' and status='0' and to_user_id="+user.getId();
		return sql;
	}

}

