Commit ea11fd40 by 周王清

报工模块的修改

修复了user_id,dept_id不能存入;
删除了bgmkDAO,多余的3个抽象方法;
user_id,正确修复了读取的值
dao.xml 优化了where
parent 69d0fe7e
...@@ -18,19 +18,8 @@ import com.jw.app.business.BgmkBusiness; ...@@ -18,19 +18,8 @@ import com.jw.app.business.BgmkBusiness;
public class actAction extends BasicAction { public class actAction extends BasicAction {
/**
*
*/
/**
*
*/
private static final long serialVersionUID = -2059356249335526616L; private static final long serialVersionUID = -2059356249335526616L;
/**
*
*/
private JSONObject jsonObject = new JSONObject(); private JSONObject jsonObject = new JSONObject();
public JSONObject getJsonObject() { public JSONObject getJsonObject() {
......
...@@ -23,22 +23,16 @@ import com.jw.app.business.BgmkBusiness; ...@@ -23,22 +23,16 @@ import com.jw.app.business.BgmkBusiness;
public class dataAction extends BasicAction{ public class dataAction extends BasicAction{
/**
*
*/
private static final long serialVersionUID = 8400799803941083524L; private static final long serialVersionUID = 8400799803941083524L;
/**
*
*/
private static final String console = null; private static final String console = null;
private JSONObject jsonObject = new JSONObject(); private JSONObject jsonObject = new JSONObject();
private int rows = 20;// 每页显示的记录数 private int rows = 20;// 每页显示的记录数
private int page = 1;// 当前第几页 private int page = 1;// 当前第几页
public JSONObject getJsonObject() { public JSONObject getJsonObject() {
return jsonObject; return jsonObject;
} }
......
...@@ -34,6 +34,12 @@ public class BgmkBusinessImpl implements BgmkBusiness { ...@@ -34,6 +34,12 @@ public class BgmkBusinessImpl implements BgmkBusiness {
if(entity.get("UUID")==null){ if(entity.get("UUID")==null){
entity.put("UUID", java.util.UUID.randomUUID().toString()); entity.put("UUID", java.util.UUID.randomUUID().toString());
} }
if(entity.get("USER_ID")==null){
entity.put("USER_ID", SessionUtil.getCode());
}
if(entity.get("DEPT_ID")==null){
entity.put("DEPT_ID", SessionUtil.getEmdepart());
}
if(entity.get("CREATE_TIME")==null){ if(entity.get("CREATE_TIME")==null){
entity.put("CREATE_TIME", new Date()); entity.put("CREATE_TIME", new Date());
} }
...@@ -48,10 +54,6 @@ public class BgmkBusinessImpl implements BgmkBusiness { ...@@ -48,10 +54,6 @@ public class BgmkBusinessImpl implements BgmkBusiness {
entity.put("DEPT_NAME", SessionUtil.getEmdepartname()); entity.put("DEPT_NAME", SessionUtil.getEmdepartname());
} }
// if(entity.get("SAVEDAYS")==null){
// String ls_savedays = PropUtil.getValue("set_savedays", "quartz_service", "14");
// entity.put("SAVEDAYS", Integer.parseInt(ls_savedays));
// }
//动态传值插入 //动态传值插入
List<String> infoListKey = new ArrayList<String>(); List<String> infoListKey = new ArrayList<String>();
List<Object> infoList = new ArrayList<Object>(); List<Object> infoList = new ArrayList<Object>();
...@@ -141,7 +143,7 @@ public class BgmkBusinessImpl implements BgmkBusiness { ...@@ -141,7 +143,7 @@ public class BgmkBusinessImpl implements BgmkBusiness {
int pageStart = (pageNo - 1) * pageSize; int pageStart = (pageNo - 1) * pageSize;
//获取列表 //获取列表
List<Map<String, Object>> items = bgmkDAO.list_bgmk_employee(new RowBounds(pageStart, pageSize), query); List<Map<String, Object>> items = bgmkDAO.list_bgmk(new RowBounds(pageStart, pageSize), query);
//获取列表个数 //获取列表个数
int count = listCount_bgmk_employee(query); int count = listCount_bgmk_employee(query);
...@@ -159,7 +161,7 @@ public class BgmkBusinessImpl implements BgmkBusiness { ...@@ -159,7 +161,7 @@ public class BgmkBusinessImpl implements BgmkBusiness {
public List<Map<String, Object>> list_bgmk_employee(Map<String, Object> query) throws BusinessException { public List<Map<String, Object>> list_bgmk_employee(Map<String, Object> query) throws BusinessException {
List<Map<String, Object>> list_data = CacheKit.get("ehcache10", "bgmk_employee"+query); List<Map<String, Object>> list_data = CacheKit.get("ehcache10", "bgmk_employee"+query);
if(list_data==null || list_data.size()==0){ if(list_data==null || list_data.size()==0){
list_data=bgmkDAO.list_bgmk_employee(query); list_data=bgmkDAO.list_bgmk(query);
CacheKit.put("ehcache10", "bgmk_employee"+query, list_data); CacheKit.put("ehcache10", "bgmk_employee"+query, list_data);
} }
return list_data; return list_data;
...@@ -167,7 +169,7 @@ public class BgmkBusinessImpl implements BgmkBusiness { ...@@ -167,7 +169,7 @@ public class BgmkBusinessImpl implements BgmkBusiness {
@Override @Override
public int listCount_bgmk_employee(Map<String, Object> query) throws BusinessException { public int listCount_bgmk_employee(Map<String, Object> query) throws BusinessException {
return bgmkDAO.listCount_bgmk_employee(query); return bgmkDAO.listCount_bgmk(query);
} }
} }
......
...@@ -21,11 +21,6 @@ public interface bgmkDAO { ...@@ -21,11 +21,6 @@ public interface bgmkDAO {
int listCount_bgmk(Map<String, Object> query) throws BusinessException ; int listCount_bgmk(Map<String, Object> query) throws BusinessException ;
List<Map<String,Object>> list_bgmk_employee(RowBounds rowbounds, Map<String, Object> query) throws BusinessException ;
List<Map<String,Object>> list_bgmk_employee(Map<String,Object> query) throws BusinessException ;
int listCount_bgmk_employee(Map<String, Object> query) throws BusinessException ;
} }
...@@ -2,6 +2,49 @@ ...@@ -2,6 +2,49 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.jw.app.business.bgmk.bgmkDAO"> <mapper namespace="com.jw.app.business.bgmk.bgmkDAO">
<sql id="where_bg">
<where>
<trim prefixOverrides="AND |OR">
<if test="UUID != null and UUID != ''">
and f.UUID = #{UUID}
</if>
<if test="USER_NAME != null and USER_NAME != ''">
and f.USER_NAME like '%${USER_NAME}%'
</if>
<if test="USER_ID != null and USER_ID != ''">
and f.USER_ID = #{USER_ID}
</if>
<if test="DEPT_NAME != null and DEPT_NAME != ''">
and f.DEPT_NAME = #{DEPT_NAME}
</if>
<if test="CONTENT != null and CONTENT != ''">
and f.CONTENT = #{CONTENT}
</if>
<if test="GZYS != null and GZYS != ''">
and f.GZYS = #{GZYS}
</if>
<if test="BG_TIME != null and BG_TIME != ''">
and f.BG_TIME = #{BG_TIME}
</if>
<if test="BG_TYPE != null and BG_TYPE != ''">
and f.BG_TYPE = #{BG_TYPE}
</if>
<if test="USER_TYPE != null and USER_TYPE != ''">
and f.USER_TYPE = #{USER_TYPE}
</if>
<if test="CREATOR_ID != null and CREATOR_ID != ''">
and f.CREATOR_ID = #{CREATOR_ID}
</if>
<if test="CREATE_TIME != null and CREATE_TIME != ''">
and f.CREATE_TIME = #{CREATE_TIME}
</if>
</trim>
</where>
</sql>
<insert id="insert_bgmk" parameterType="map"> <insert id="insert_bgmk" parameterType="map">
insert into WORK_BG( insert into WORK_BG(
<trim prefix="" suffixOverrides=","> <trim prefix="" suffixOverrides=",">
...@@ -21,206 +64,44 @@ ...@@ -21,206 +64,44 @@
<update id="update_bgmk" parameterType="map"> <update id="update_bgmk" parameterType="map">
<![CDATA[ <![CDATA[
update WORK_BG set update WORK_BG set
]]> ]]>
<trim prefix="" suffixOverrides=","> <trim prefix="" suffixOverrides=",">
<foreach collection="info" item="info"> <foreach collection="info" item="info">
${info.key} = #{info.value} , ${info.key} = #{info.value} ,
</foreach> </foreach>
</trim> </trim>
<where> <where>
<if test="UUID != null and UUID != ''"> <if test="UUID != null and UUID != ''">
and UUID = #{UUID} and UUID = #{UUID}
</if> </if>
</where> </where>
</update> </update>
<delete id="delete_bgmk" parameterType="list"> <delete id="delete_bgmk" parameterType="list">
<![CDATA[ <![CDATA[
delete from WORK_BG where UUID IN delete from WORK_BG where UUID IN
]]> ]]>
<foreach collection="list" item="UUID" open="(" separator="," <foreach collection="list" item="UUID" open="(" separator=","
close=")"> close=")">
#{UUID} #{UUID}
</foreach> </foreach>
</delete> </delete>
<select id="list_bgmk" parameterType="map" resultType="upperCaseKeyMap"> <select id="list_bgmk" parameterType="map" resultType="upperCaseKeyMap">
<![CDATA[ <![CDATA[
select f.* select f.*
from WORK_BG f where 1=1 from WORK_BG f where 1=1
]]> ]]>
<if test="UUID != null and UUID != ''"> <include refid="where_bg" />
and f.UUID = #{UUID} order by f.CREATE_TIME DESC
</if>
<if test="USER_NAME != null and USER_NAME != ''">
and f.USER_NAME like '%${USER_NAME}%'
</if>
<if test="USER_ID != null and USER_ID != ''">
and f.USER_ID = #{USER_ID}
</if>
<if test="DEPT_NAME != null and DEPT_NAME != ''">
and f.DEPT_NAME = #{DEPT_NAME}
</if>
<if test="CONTENT != null and CONTENT != ''">
and f.CONTENT = #{CONTENT}
</if>
<if test="GZYS != null and GZYS != ''">
and f.GZYS = #{GZYS}
</if>
<if test="BG_TIME != null and BG_TIME != ''">
and f.BG_TIME = #{BG_TIME}
</if>
<if test="BG_TYPE != null and BG_TYPE != ''">
and f.BG_TYPE = #{BG_TYPE}
</if>
<if test="USER_TYPE != null and USER_TYPE != ''">
and f.USER_TYPE = #{USER_TYPE}
</if>
<if test="CREATOR_ID != null and CREATOR_ID != ''">
and f.CREATOR_ID = #{CREATOR_ID}
</if>
<if test="CREATE_TIME != null and CREATE_TIME != ''">
and f.CREATE_TIME = #{CREATE_TIME}
</if>
order by f.CREATE_TIME DESC
</select> </select>
<select id="listCount_bgmk" parameterType="map" resultType="int">
<![CDATA[
select count(*) c from WORK_BG f where 1=1
]]>
<if test="UUID != null and UUID != ''">
and f.UUID = #{UUID}
</if>
<if test="USER_NAME != null and USER_NAME != ''">
and f.USER_NAME like '%${USER_NAME}%'
</if>
<if test="USER_ID != null and USER_ID != ''">
and f.USER_ID = #{USER_ID}
</if>
<if test="DEPT_NAME != null and DEPT_NAME != ''">
and f.DEPT_NAME = #{DEPT_NAME}
</if>
<if test="CONTENT != null and CONTENT != ''">
and f.CONTENT = #{CONTENT}
</if>
<if test="GZYS != null and GZYS != ''">
and f.GZYS = #{GZYS}
</if>
<if test="BG_TIME != null and BG_TIME != ''">
and f.BG_TIME = #{BG_TIME}
</if>
<if test="BG_TYPE != null and BG_TYPE != ''">
and f.BG_TYPE = #{BG_TYPE}
</if>
<if test="USER_TYPE != null and USER_TYPE != ''">
and f.USER_TYPE = #{USER_TYPE}
</if>
<if test="CREATOR_ID != null and CREATOR_ID != ''">
and f.CREATOR_ID = #{CREATOR_ID}
</if>
<if test="CREATE_TIME != null and CREATE_TIME != ''">
and f.CREATE_TIME = #{CREATE_TIME}
</if>
</select>
<select id="list_bgmk_employee" parameterType="map" resultType="upperCaseKeyMap"> <select id="listCount_bgmk" parameterType="map" resultType="int">
<![CDATA[ <![CDATA[
select f.* select count(*) c from WORK_BG f where 1=1
from WORK_BG f where 1=1 ]]>
]]> <include refid="where_send" />
<if test="UUID != null and UUID != ''">
and f.UUID = #{UUID}
</if>
<if test="USER_NAME != null and USER_NAME != ''">
and f.USER_NAME like '%${USER_NAME}%'
</if>
<if test="USER_ID != null and USER_ID != ''">
and f.USER_ID = #{USER_ID}
</if>
<if test="DEPT_NAME != null and DEPT_NAME != ''">
and f.DEPT_NAME = #{DEPT_NAME}
</if>
<if test="CONTENT != null and CONTENT != ''">
and f.CONTENT = #{CONTENT}
</if>
<if test="GZYS != null and GZYS != ''">
and f.GZYS = #{GZYS}
</if>
<if test="BG_TIME != null and BG_TIME != ''">
and f.BG_TIME = #{BG_TIME}
</if>
<if test="BG_TYPE != null and BG_TYPE != ''">
and f.BG_TYPE = #{BG_TYPE}
</if>
<if test="USER_TYPE != null and USER_TYPE != ''">
and f.USER_TYPE = #{USER_TYPE}
</if>
<if test="CREATOR_ID != null and CREATOR_ID != ''">
and f.CREATOR_ID = #{CREATOR_ID}
</if>
<if test="CREATE_TIME != null and CREATE_TIME != ''">
and f.CREATE_TIME = #{CREATE_TIME}
</if>
order by f.CREATE_TIME DESC
</select> </select>
<select id="listCount_bgmk_employee" parameterType="map" resultType="int">
<![CDATA[
select count(*) c from WORK_BG f where 1=1
]]>
<if test="UUID != null and UUID != ''">
and f.UUID = #{UUID}
</if>
<if test="USER_NAME != null and USER_NAME != ''">
and f.USER_NAME like '%${USER_NAME}%'
</if>
<if test="USER_ID != null and USER_ID != ''">
and f.USER_ID = #{USER_ID}
</if>
<if test="DEPT_NAME != null and DEPT_NAME != ''">
and f.DEPT_NAME = #{DEPT_NAME}
</if>
<if test="CONTENT != null and CONTENT != ''">
and f.CONTENT = #{CONTENT}
</if>
<if test="GZYS != null and GZYS != ''">
and f.GZYS = #{GZYS}
</if>
<if test="BG_TIME != null and BG_TIME != ''">
and f.BG_TIME = #{BG_TIME}
</if>
<if test="BG_TYPE != null and BG_TYPE != ''">
and f.BG_TYPE = #{BG_TYPE}
</if>
<if test="USER_TYPE != null and USER_TYPE != ''">
and f.USER_TYPE = #{USER_TYPE}
</if>
<if test="CREATOR_ID != null and CREATOR_ID != ''">
and f.CREATOR_ID = #{CREATOR_ID}
</if>
<if test="CREATE_TIME != null and CREATE_TIME != ''">
and f.CREATE_TIME = #{CREATE_TIME}
</if>
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -16,10 +16,7 @@ import net.sf.json.JSONObject; ...@@ -16,10 +16,7 @@ import net.sf.json.JSONObject;
public class actAction extends BasicAction { public class actAction extends BasicAction {
/**
*
*/
private static final long serialVersionUID = 3380082635300076202L;
private JSONObject jsonObject = new JSONObject(); private JSONObject jsonObject = new JSONObject();
public JSONObject getJsonObject() { public JSONObject getJsonObject() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment