标签:post etc 查询 from UNC select rom exception hash
SELECT r.*
FROM employee_role e
LEFT JOIN role r
ON e.role_id=r.id
WHERE e.employee_id = #{id}
select p.expression
from employee_role er
left JOIN role_permission rp
ON er.role_id = rp.role_id
LEFT JOIN permission p
ON rp.permission_id = p.id
WHERE er.employee_id = #{id}
function permissionset(){
alert(1111);
$.post(‘/permission/reload.do‘, function (obj){
if(obj.success){
$.messager.alert("温馨提示","保存成功1s后关闭");
window.setTimeout(function (){
window.location.reload();
},1000);
}else {
alert(obj.msg);
}
});
}
@RequestMapping("/reload")
@ResponseBody
public JsonResult reload() {
try {
//查询数据库中所有的权限表达式
List<String> list = permissionService.selectAllExperssion();
//找IOC要所有含有@controller注解的bean
Map<String, Object> beans = ctx.getBeansWithAnnotation(Controller.class);
//把map中所有的bean提取到collection中
Collection<Object> controllercglisb = beans.values();
for (Object controller : controllercglisb) {
if (AopUtils.isCglibProxy(controllercglisb)) {
continue;
}
Class clazz = controllercglisb.getClass().getSuperclass();
Method[] methods = clazz.getDeclaredMethods();
for (Method method : methods) {
RequiresPermissions requiresPermissions = method.getAnnotation(RequiresPermissions.class);
if (requiresPermissions != null) {
String[] expandname = requiresPermissions.value();
String expression = expandname[0];
String name = expandname[1];
if (list.contains(expandname)) {
Permission permission = new Permission();
permission.setName(name);
permission.setExpression(expression);
permissionService.insert(permission);
}
}
}
}
return new JsonResult(true, "重新加载成功");
} catch (Exception e) {
return new JsonResult(false,"重新加载失败");
}
}
<select id="selectCustomerReport" resultType="java.util.HashMap">
select ${groupType} groupType,count(c.id) number,c.gender from customer c
left join employee e on c.seller_id = e.id
<where>
c.status = 0
<if test="keyword != null">
and e.name like concat(‘%‘,#{keyword},‘%‘)
</if>
<if test="beginDate != null">
and c.input_time >= #{beginDate}
</if>
<if test="endDate != null">
and c.input_time <= #{endDate}
</if>
</where>
group by ${groupType}
</select>
@RequestMapping("/listByBar")
private String listByBar(@ModelAttribute("qo") customerReportQuery qo, Model model){
List<HashMap> list = customerReportService.listALL(qo);
ArrayList xList = new ArrayList();
ArrayList yList = new ArrayList();
Iterator iterator = list.iterator();
while (iterator.hasNext()){
Map map = (Map) iterator.next();
xList.add(map.get("groupType"));
yList.add(map.get("number"));
}
model.addAttribute("xList", JSON.toJSONString(xList));
model.addAttribute("yList", JSON.toJSONString(yList));
model.addAttribute("groupTypeName", MessageUtil.changMsg(qo));
return "customerReport/listByBar";
}
标签:post etc 查询 from UNC select rom exception hash
原文地址:https://www.cnblogs.com/zfjcool/p/14092114.html