String roles1="";
String sql="";
//1.获取用户
TSUser user = ResourceUtil.getSessionUser();
//2.获取用户的角色
List
for (TSRoleUser ru : rUsers1) {
//3.获取角色对应的规则id
List
for (String string : datarules) {
if(StringUtil.isNotEmpty(string)){
for (String datarule : string.split(",")) {
if(StringUtil.isNotEmpty(datarule)){
//4.获取规则名称的sql语句
String rulevalue=jdbcTemplate.queryForObject("select rule_value from t_s_data_rule where id =? ",String.class,datarule) ;
if(rulevalue.contains("goods_Place")){
//5.做逻辑判断
sql= sql+" and " +rulevalue;
}
}
}
}
}
}