一、会议通知
会议通知sql语句
select t1.* ,IFNULL(f.result,-1)result from
(select * from t_oa_meeting_info where FIND_IN_SET(2,CONCAT(canyuze,',',liexize,',',zhuchiren))and state=4 ) t1
left JOIN t_oa_meeting_feedback f on t1.id=f.meetingId and f.personId=2 order by result ;
.config.
layui.config({
base: 'static/js/layui/modules/' //假设这是test.js所在的目录
}).extend({ //设定模块别名
test: 'test' //如果test.js是在根目录,也可以不用设定别名
});
header.jsp
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!-- 引入 layui.css -->
<link rel="stylesheet" href="${pageContext.request.contextPath }/static/js/layui/css/layui.css">
<!-- 引入 layui.js -->
<script src="${pageContext.request.contextPath }/static/js/layui/layui.js"></script>
<base href="${pageContext.request.contextPath }/">
<!-- 引入formSelects核心css -->
<link rel="stylesheet" href="${pageContext.request.contextPath }/static/js/plugins/formSelects/formSelects-v4.css" />
<!-- 引入formSelects核心js -->
<script src="${pageContext.request.contextPath }/static/js/plugins/formSelects/formSelects-v4.js" type="text/javascript" charset="utf-8"></script>
<!-- 引入config.js -->
<script src="${pageContext.request.contextPath }/static/js/layui/config.js" type="text/javascript" charset="utf-8"></script><input id="ctx" value="${pageContext.request.contextPath }" type="hidden" >
配置文件mvc.xml
<?xml version="1.0" encoding="UTF-8"?>
<config>
<action path="/permission" type="com.zking.web.PermissonAction">
</action>
<action path="/user" type="com.zking.web.UserAction">
</action>
<action path="/info" type="com.zking.util.MeetingInfoAction">
</action>
<action path="/audit" type="com.zking.util.MeetingAuditAction">
</action>
<action path="/feedBack" type="com.zking.web.MeetingFeedbackAction">
</action>
</config>
MeetingFeedbackAction类
package com.zking.web;
import java.util.List;
import java.util.Map;import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;import com.zking.dao.MeetingFeedbackDao;
import com.zking.entity.MeetingFeedBack;
import com.zking.framework.ActionSupport;
import com.zking.framework.ModelDriver;
import com.zking.util.PageBean;
import com.zking.util.R;
import com.zking.util.ResponseUtil;public class MeetingFeedbackAction extends ActionSupport implements ModelDriver<MeetingFeedBack>{
private MeetingFeedBack back =new MeetingFeedBack();
private MeetingFeedbackDao feedbackDao =new MeetingFeedbackDao();
//我的会议通知
public String queryMeetingFeedBackByUserId(HttpServletRequest req, HttpServletResponse resp) {
try {
PageBean pagebean=new PageBean();
pagebean.setRequest(req);//设置界面跳转方式
List<Map<String, Object>> ls=feedbackDao.queryMeetingFeedBackByUserId(back, pagebean);
ResponseUtil.writeJson(resp, R.ok(0, "会议通知数据查询成功", pagebean.getTotal(),ls));
} catch (Exception e) {
e.printStackTrace();
try {
ResponseUtil.writeJson(resp, R.error(0, "会议通知数据查询失败"));
} catch (Exception e2) {
e2.printStackTrace();
}
}
return null;
}
@Override
public MeetingFeedBack getModel() {
return back;
}
}
dao方法
package com.zking.dao;
import java.sql.SQLException;
import java.util.List;
import java.util.Map;import com.zking.entity.MeetingFeedBack;
import com.zking.entity.MeetingInfo;
import com.zking.util.BaseDao;
import com.zking.util.PageBean;
import com.zking.util.StringUtils;public class MeetingFeedbackDao extends BaseDao<MeetingFeedBack>{
//我的会议通知
public List<Map<String, Object>> queryMeetingFeedBackByUserId(MeetingFeedBack back, PageBean pageBean)
throws SQLException, InstantiationException, IllegalAccessException {
// String sql="select t1.* ,IFNULL(f.result,-1)result from \r\n" +
// "(select * from t_oa_meeting_info where FIND_IN_SET("+back.getPersonId()+",CONCAT(canyuze,',',liexize,',',zhuchiren))) t1 \r\n" +
// "left JOIN t_oa_meeting_feedback f on t1.id=f.meetingId and f.personId="+back.getPersonId()+" order by t1.id desc ";//调用sql语句
String sql="select t1.*,ifnull(f.result,-1) result from \r\n" +
"(select * from t_oa_meeting_info where "
+ "find_in_set('"+back.getPersonId()+"',concat(canyuze,',',liexize,',',zhuchiren))) t1 \r\n" +
"left join t_oa_meeting_feedback f on "
+ "t1.id=f.meetin