|
|
@@ -4,6 +4,7 @@ import common.BaseClass;
|
|
|
import common.Controller;
|
|
|
import common.YosException;
|
|
|
import common.data.QuerySQL;
|
|
|
+import common.data.Rows;
|
|
|
import common.data.SQLFactory;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
@@ -13,24 +14,19 @@ public class Proxy extends BaseClass {
|
|
|
|
|
|
//获取当前账号的代理人
|
|
|
public static ArrayList<Long> getProxyHrids(Controller controller) throws YosException {
|
|
|
- QuerySQL querySQL = SQLFactory.createQuerySQL(controller, "sys_userteam", "userid")
|
|
|
- .setTableAlias("t1");
|
|
|
- querySQL.addJoinTable(JOINTYPE.left,"sys_hr","t2","t2.userid=t1.userid and t2.siteid=t1.siteid","hrid");
|
|
|
- querySQL.setSiteid(controller.siteid);
|
|
|
- querySQL.setWhere("t1.isproxy", 1);
|
|
|
- querySQL.setWhere("t1.createuserid", controller.userid);
|
|
|
- return querySQL.query().toArrayList("hrid", new ArrayList<>());
|
|
|
-
|
|
|
+ String Sql = "select t1.createuserid userid,t2.hrid from sys_userteam t1 " +
|
|
|
+ "inner join sys_hr t2 on t1.siteid = t2.siteid and t1.createuserid = t2.userid " +
|
|
|
+ "where t1.siteid = '" + controller.siteid + "' and t1.userid = '" + controller.userid + "' and t1.isproxy = '1'";
|
|
|
+ Rows rows = controller.dbConnect.runSqlQuery(Sql);
|
|
|
+ return rows.toArrayList("hrid", new ArrayList<>());
|
|
|
}
|
|
|
|
|
|
public static ArrayList<Long> getProxyUserids(Controller controller) throws YosException {
|
|
|
- QuerySQL querySQL = SQLFactory.createQuerySQL(controller, "sys_userteam", "userid")
|
|
|
- .setTableAlias("t1");
|
|
|
- querySQL.setSiteid(controller.siteid);
|
|
|
- querySQL.setWhere("t1.isproxy", 1);
|
|
|
- querySQL.setWhere("t1.createuserid", controller.userid);
|
|
|
- return querySQL.query().toArrayList("userid", new ArrayList<>());
|
|
|
-
|
|
|
+ String Sql = "select t1.createuserid userid,t2.hrid from sys_userteam t1 " +
|
|
|
+ "inner join sys_hr t2 on t1.siteid = t2.siteid and t1.createuserid = t2.userid " +
|
|
|
+ "where t1.siteid = '" + controller.siteid + "' and t1.userid = '" + controller.userid + "' and t1.isproxy = '1'";
|
|
|
+ Rows rows = controller.dbConnect.runSqlQuery(Sql);
|
|
|
+ return rows.toArrayList("userid", new ArrayList<>());
|
|
|
}
|
|
|
|
|
|
}
|