소스 검색

Merge branch 'master' of https://git.steerinfo.com/DAL-DAZHOU/DAL-DAZHOU-AMS-API

luobang 2 년 전
부모
커밋
b80e363ee5

+ 4 - 3
src/main/java/com/steerinfo/dil/controller/DilNoticeController.java

@@ -194,7 +194,8 @@ public class DilNoticeController extends BaseRESTfulController {
     @PostMapping(value = "/updateNoticeStatus")
     public RESTfulResult updateNoticeStatus(@RequestBody(required = false) Map<String, Object> map){
         String userId = (String) map.get("userId");
-        int result = dilNoticeService.updateNoticeStatus(userId);
+        int noticeId= (int) map.get("noticeId");
+        int result = dilNoticeService.updateNoticeStatus(userId,noticeId);
         return success(result);
     }
 
@@ -277,8 +278,8 @@ public class DilNoticeController extends BaseRESTfulController {
 
     /**
      * @author:zyf
-     * @version:1.0
-     * @Date:
+     * @version:2.0
+     * @Date:2022-10-14
      * @Description:获取通知数据
     */
     @ApiOperation(value = "查询通知信息", notes = "根据传过来的orgcode查询")

+ 42 - 2
src/main/java/com/steerinfo/dil/mapper/DilNoticeMapper.java

@@ -23,6 +23,7 @@ public interface DilNoticeMapper extends IBaseMapper<DilNotice, BigDecimal> {
 
     List<Map<String, Object>> getNoticeById(BigDecimal id);
 
+    List<Map<String, Object>> getNoticeById1(BigDecimal id);
     //销售公司查看公告
     List<Map<String, Object>> getMarketingNoticeList(Map<String, Object> mapVal);
     //收货客户查看公告
@@ -30,6 +31,13 @@ public interface DilNoticeMapper extends IBaseMapper<DilNotice, BigDecimal> {
     //根据不同的用户发放不同的最新消息
     List<Map<String, Object>> getNewNoticeByPermission(BigDecimal permission);
 
+    /**
+     * @author:zyf
+     * @version:1.0
+     * @Date:2022-10-14
+     * @Description:
+    */
+    String getStatus(BigDecimal id);
     /**
      * @author:zyf
      * @version:1.0
@@ -99,7 +107,7 @@ public interface DilNoticeMapper extends IBaseMapper<DilNotice, BigDecimal> {
      * @Date:2022-09-26
      * @Description:根据通知ID来查询历史orgcode
      */
-    String gethistoryorgCode(BigDecimal noticeid);
+    DilNotice gethistoryorgCode(BigDecimal noticeid);
 
     /**
      * @author:zyf
@@ -107,7 +115,15 @@ public interface DilNoticeMapper extends IBaseMapper<DilNotice, BigDecimal> {
      * @Date:2022-09-24
      * @Description:根据用户id来更新状态
     */
-    int updatestatus(String userId);
+    int updatestatus(String userId,int noticeId);
+
+    /**
+     * @author:zyf
+     * @version:1.0
+     * @Date:2022-10-14
+     * @Description:
+    */
+    int gettaskAllNum(String userId);
 
     /**
      * @author:zyf
@@ -116,4 +132,28 @@ public interface DilNoticeMapper extends IBaseMapper<DilNotice, BigDecimal> {
      * @Description:根据用户ID来查询名字
     */
     String queryName(String userId);
+
+    /**
+     * @author:zyf
+     * @version:1.0
+     * @Date:2022-10-14
+     * @Description:删除历史数据
+    */
+    int updatehistorydata(DilNotice dilNotice);
+
+    /**
+     * @author:zyf
+     * @version:1.0
+     * @Date:2022-10-14
+     * @Description:更新一下时间
+    */
+    int updateTime(DilNotice dilNotice);
+
+    /**
+     * @author:zyf
+     * @version:1.0
+     * @Date:2022-10-14
+     * @Description:修改数据
+    */
+    int modifyData(DilNotice dilNotice);
 }

+ 38 - 0
src/main/java/com/steerinfo/dil/model/DilNotice.java

@@ -1,13 +1,18 @@
 package com.steerinfo.dil.model;
 
+import com.fasterxml.jackson.annotation.JsonFormat;
 import com.steerinfo.framework.model.IBasePO;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
+import io.swagger.annotations.ApiParam;
+import org.apache.ibatis.type.Alias;
+import org.springframework.format.annotation.DateTimeFormat;
 
 import java.math.BigDecimal;
 import java.util.Date;
 
 @ApiModel(value="面向承运商发布通知")
+@Alias("dilNotice")
 public class DilNotice implements IBasePO<BigDecimal> {
     /**
      * 通知ID(NOTICE_ID,DECIMAL,38)
@@ -82,6 +87,39 @@ public class DilNotice implements IBasePO<BigDecimal> {
     @ApiModelProperty(value="存放历史信息",required=false)
     private String historicalChanges;
 
+    @ApiModelProperty(value = "修改过后的通知标题",required = false)
+    private String updateTitle;
+
+    @ApiModelProperty(value = "修改过后的通知内容",required = false)
+    private String updateContent;
+
+    @ApiModelProperty(value = "修改状态(未修改 0;已修改:1)",required = false)
+    private String status;
+
+    public String getUpdateTitle() {
+        return updateTitle;
+    }
+
+    public void setUpdateTitle(String updateTitle) {
+        this.updateTitle = updateTitle;
+    }
+
+    public String getUpdateContent() {
+        return updateContent;
+    }
+
+    public void setUpdateContent(String updateContent) {
+        this.updateContent = updateContent;
+    }
+
+    public String getStatus() {
+        return status;
+    }
+
+    public void setStatus(String status) {
+        this.status = status;
+    }
+
     public String getHistoricalChanges() {
         return historicalChanges;
     }

+ 1 - 1
src/main/java/com/steerinfo/dil/service/IDilNoticeService.java

@@ -29,7 +29,7 @@ public interface IDilNoticeService {
 
     int updateNotice(DilNotice dilNotice);
 
-    int updateNoticeStatus(String userId);
+    int updateNoticeStatus(String userId,int noticeId);
 
     int deleteNotice(BigDecimal id);
 

+ 104 - 38
src/main/java/com/steerinfo/dil/service/impl/DilNoticeServiceImpl.java

@@ -44,7 +44,17 @@ public class DilNoticeServiceImpl  implements IDilNoticeService {
      * */
     @Override
     public List<Map<String, Object>> getCarrierNoticeList(Map<String, Object> mapVal) {
-        return dilNoticeMapper.getCarrierNoticeList(mapVal);
+        List<Map<String, Object>> mapList=dilNoticeMapper.getCarrierNoticeList(mapVal);
+        for (Map<String, Object> map : mapList) {
+            if ("1".equals(map.get("status"))){
+                //有历史数据(替换)
+                map.put("noticeTitle",map.get("updateTitle"));
+                map.put("noticeContent",map.get("updateContent"));
+                map.put("insertUsername",map.get("updateUsername"));
+                map.put("insertTime",map.get("updateTime"));
+            }
+        }
+        return mapList;
     }
 
     /**
@@ -52,7 +62,17 @@ public class DilNoticeServiceImpl  implements IDilNoticeService {
      * */
     @Override
     public List<Map<String, Object>> getMarketingNoticeList(Map<String, Object> mapVal) {
-        return dilNoticeMapper.getMarketingNoticeList(mapVal);
+        List<Map<String, Object>> mapList=dilNoticeMapper.getMarketingNoticeList(mapVal);
+        for (Map<String, Object> map : mapList) {
+            if ("1".equals(map.get("status"))){
+                //有历史数据(替换)
+                map.put("noticeTitle",map.get("updateTitle"));
+                map.put("noticeContent",map.get("updateContent"));
+                map.put("insertUsername",map.get("updateUsername"));
+                map.put("insertTime",map.get("updateTime"));
+            }
+        }
+        return mapList;
     }
 
 
@@ -62,7 +82,17 @@ public class DilNoticeServiceImpl  implements IDilNoticeService {
 
     @Override
     public List<Map<String, Object>> getClientNoticeList(Map<String, Object> mapVal) {
-        return dilNoticeMapper.getClientNoticeList(mapVal);
+        List<Map<String, Object>> mapList= dilNoticeMapper.getClientNoticeList(mapVal);
+        for (Map<String, Object> map : mapList) {
+            if ("1".equals(map.get("status"))){
+                //有历史数据(替换)
+                map.put("noticeTitle",map.get("updateTitle"));
+                map.put("noticeContent",map.get("updateContent"));
+                map.put("insertUsername",map.get("updateUsername"));
+                map.put("insertTime",map.get("updateTime"));
+            }
+        }
+        return mapList;
     }
 
 
@@ -80,13 +110,14 @@ public class DilNoticeServiceImpl  implements IDilNoticeService {
     public int insertNotice(DilNotice dilNotice) {
         int result=0;
         dilNotice.setDeleted(new BigDecimal(0));
-        dilNotice.setInsertTime(new Date());
+        dilNotice.setInsertTime(dilNotice.getInsertTime());
         dilNotice.setNoticeId(dilNoticeMapper.selectNoticeId());
+        dilNotice.setStatus("0");
         if(dilNotice.getPermissions()!=null){
             if(dilNotice.getPermissions().equals("承运商")){
                 dilNotice.setPermission("chengyunshang");
             }
-            else if(dilNotice.getPermissions().equals("销售")){
+            else if(dilNotice.getPermissions().equals("销售公司")){
                 dilNotice.setPermission("wuliuyunshubu");
             }
             else if(dilNotice.getPermissions().equals("收货客户")){
@@ -107,6 +138,12 @@ public class DilNoticeServiceImpl  implements IDilNoticeService {
         return result;
     }
 
+    /**
+     * @author:zyf
+     * @version:2.0
+     * @Date:2022-10-14
+     * @Description:发布通知
+    */
     @Override
     public int releaseNotice(DilNotice dilNotice) {
         //发布通知
@@ -114,21 +151,48 @@ public class DilNoticeServiceImpl  implements IDilNoticeService {
         //2.看notice有无历史的修改数据
         //3.发布
         int result=0;
+        //发布的通知
+        DilNotice dilNotice2=new DilNotice();
         if (dilNotice.getPermission()!=null){
             //查询是否有历史修改数据
-            String code = dilNoticeMapper.gethistoryorgCode(dilNotice.getNoticeId());
-            //历史数据有值与否
-            if (code!=null&&!("".equals(code))){
-                if (!code.equals(dilNotice.getPermission())){
-                    dilNoticeMapper.deleteNoticeUsers(dilNotice.getNoticeId());
-                    if ("qita".equals(dilNotice.getPermission())){
-                        //全部要单独
-                        result+=dilNoticeMapper.insertIntoNoticeUser1(dilNotice);
-                    }else {
-                        result+=dilNoticeMapper.insertIntoNoticeUser(dilNotice);
-                    }
+            DilNotice dilNotice1 = dilNoticeMapper.gethistoryorgCode(dilNotice.getNoticeId());
+            //历史数据有值与否(1为有值,0为没有值)
+            if ("1".equals(dilNotice1.getStatus())){
+                dilNoticeMapper.deleteNoticeUsers(dilNotice.getNoticeId());
+                //1.判断时间是否需要修改(1.1)
+                Date updateTime = dilNotice1.getUpdateTime();
+                if (updateTime.compareTo(new Date())>0){
+                    //时间大于当前时间的不动
+                    dilNotice2.setInsertTime(updateTime);
+                }else {
+                    //时间小于等于当前时间的,时间变为当前时间
+                    dilNotice2.setInsertTime(new Date());
+                }
+                //历史数据
+                dilNotice2.setNoticeId(dilNotice.getNoticeId());
+                dilNotice2.setNoticeTitle(dilNotice1.getUpdateTitle());
+                dilNotice2.setNoticeContent(dilNotice1.getUpdateContent());
+                dilNotice2.setInsertUsername(dilNotice1.getUpdateUsername());
+                dilNoticeMapper.updatehistorydata(dilNotice2);
+                if ("qita".equals(dilNotice.getPermission())){
+                    //全部要单独
+                    result+=dilNoticeMapper.insertIntoNoticeUser1(dilNotice);
+                }else {
+                    result+=dilNoticeMapper.insertIntoNoticeUser(dilNotice);
                 }
             }else {
+                //判断时间是否需要修改(1.2)
+                Date insertTime =dilNotice.getInsertTime();
+                dilNoticeMapper.deleteNoticeUsers(dilNotice.getNoticeId());
+                if (insertTime.compareTo(new Date())>0){
+                    //时间大于当前时间的不动
+                    dilNotice2.setInsertTime(dilNotice.getInsertTime());
+                }else {
+                    //时间小于等于当前时间的,时间变为当前时间
+                    dilNotice2.setInsertTime(new Date());
+                }
+                dilNotice2.setNoticeId(dilNotice.getNoticeId());
+                dilNoticeMapper.updateTime(dilNotice2);
                 if ("qita".equals(dilNotice.getPermission())){
                     //全部要单独
                     result+=dilNoticeMapper.insertIntoNoticeUser1(dilNotice);
@@ -148,30 +212,26 @@ public class DilNoticeServiceImpl  implements IDilNoticeService {
     @Override
     public int updateNotice(DilNotice dilNotice) {
         dilNotice.setUpdateTime(new Date());
+        //存储修改过后的内容
+        DilNotice dilNotice1=new DilNotice();
         dilNotice.setUpdateUsername("admin");
         if ("承运商".equals(dilNotice.getPermission())){
-            dilNotice.setPermission("chengyunshang");
-        }else if ("销售".equals(dilNotice.getPermission())){
-            dilNotice.setPermission("wuliuyunshubu");
+            dilNotice1.setPermission("chengyunshang");
+        }else if ("销售公司".equals(dilNotice.getPermission())){
+            dilNotice1.setPermission("wuliuyunshubu");
         }else if ("收货客户".equals(dilNotice.getPermission())){
-            dilNotice.setPermission("shouhuokehu");
+            dilNotice1.setPermission("shouhuokehu");
         }else {
-            dilNotice.setPermission("qita");
+            dilNotice1.setPermission("qita");
         }
         String code = dilNoticeMapper.getorgCode(dilNotice.getNoticeId());
-        dilNotice.setHistoricalChanges(code);
-        //查询orgcode是否一致
-        /*String code = dilNoticeMapper.getorgCode(dilNotice.getNoticeId());
-        if (!code.equals(dilNotice.getPermission())){
-            dilNoticeMapper.deleteNotice(dilNotice.getNoticeId());
-            if ("qita".equals(dilNotice.getPermission())){
-                //全部要单独
-                dilNoticeMapper.insertIntoNoticeUser1(dilNotice);
-            }else {
-                dilNoticeMapper.insertIntoNoticeUser(dilNotice);
-            }
-        }*/
-        return dilNoticeMapper.updateByPrimaryKeySelective(dilNotice);
+        dilNotice1.setUpdateTitle(dilNotice.getNoticeTitle());
+        dilNotice1.setUpdateContent(dilNotice.getNoticeContent());
+        dilNotice1.setUpdateTime(dilNotice.getInsertTime());
+        dilNotice1.setUpdateUsername(dilNotice.getInsertUsername());
+        dilNotice1.setStatus("1");
+        dilNotice1.setNoticeId(dilNotice.getNoticeId());
+        return dilNoticeMapper.modifyData(dilNotice1);
     }
 
     /**
@@ -181,8 +241,9 @@ public class DilNoticeServiceImpl  implements IDilNoticeService {
      * @Description:修改用户通知的相关信息
      */
     @Override
-    public int updateNoticeStatus(String userId) {
-        return dilNoticeMapper.updatestatus(userId);
+    public int updateNoticeStatus(String userId,int noticeId) {
+        dilNoticeMapper.updatestatus(userId,noticeId);
+        return dilNoticeMapper.gettaskAllNum(userId);
     }
 
 
@@ -194,7 +255,7 @@ public class DilNoticeServiceImpl  implements IDilNoticeService {
         DilNotice dilNotice = dilNoticeMapper.selectByPrimaryKey(id);
         dilNotice.setDeleted(new BigDecimal(1));
         //删除中间表信息
-        dilNoticeMapper.deleteNotice(id);
+        dilNoticeMapper.deleteNoticeUsers(id);
         //删除通知表的数据
         return dilNoticeMapper.deleteNotice(id);
     }
@@ -215,7 +276,12 @@ public class DilNoticeServiceImpl  implements IDilNoticeService {
      */
     @Override
     public List<Map<String, Object>> getNoticeById(BigDecimal id) {
-        return dilNoticeMapper.getNoticeById(id);
+        String status = dilNoticeMapper.getStatus(id);
+        if ("1".equals(status)){
+            return dilNoticeMapper.getNoticeById1(id);
+        }else {
+            return dilNoticeMapper.getNoticeById(id);
+        }
     }
 
     /**

+ 102 - 15
src/main/resources/com/steerinfo/dil/mapper/DilNoticeMapper.xml

@@ -13,15 +13,19 @@
     <result column="DELETED" jdbcType="DECIMAL" property="deleted" />
     <result column="PERMISSION" jdbcType="VARCHAR" property="permission" />
     <result column="HISTORICAL_CHANGES" jdbcType="VARCHAR" property="historicalChanges"></result>
+    <result column="UPDATE_TITLE" jdbcType="VARCHAR" property="updateTitle"></result>
+    <result column="UPDATE_CONTENT" jdbcType="VARCHAR" property="updateContent"></result>
+    <result column="STATUS" jdbcType="VARCHAR" property="status"></result>
   </resultMap>
   <sql id="columns">
     NOTICE_ID, NOTICE_TITLE, NOTICE_CONTENT, INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME, 
-    UPDATE_TIME, INSERT_UPDATE_REMARK, DELETED, PERMISSION,HISTORICAL_CHANGES
+    UPDATE_TIME, INSERT_UPDATE_REMARK, DELETED, PERMISSION,HISTORICAL_CHANGES,UPDATE_TITLE,
+    UPDATE_CONTENT,STATUS
   </sql>
   <sql id="columns_alias">
     t.NOTICE_ID, t.NOTICE_TITLE, t.NOTICE_CONTENT, t.INSERT_USERNAME, t.INSERT_TIME, 
     t.UPDATE_USERNAME, t.UPDATE_TIME, t.INSERT_UPDATE_REMARK, t.DELETED, t.PERMISSION,
-    t.HISTORICAL_CHANGES
+    t.HISTORICAL_CHANGES,t.UPDATE_TITLE,t.UPDATE_CONTENT,t.STATUS
   </sql>
   <sql id="orderBy">
     <if test="orderField != null and orderField != ''">
@@ -187,6 +191,9 @@
       <if test="permission != null">
         PERMISSION,
       </if>
+      <if test="status != null">
+        STATUS,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
       <if test="noticeId != null">
@@ -219,6 +226,9 @@
       <if test="permission != null">
         #{permission,jdbcType=DECIMAL},
       </if>
+      <if test="status != null">
+        #{status,jdbcType=DECIMAL},
+      </if>
     </trim>
   </insert>
   <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.DilNotice">
@@ -412,14 +422,18 @@
   <select id="getCarrierNoticeList" parameterType="java.util.Map" resultType="java.util.Map">
     SELECT * FROM
     (
-
     SELECT
     DN.NOTICE_ID AS "noticeId",
     DN.NOTICE_TITLE AS "noticeTitle",
     DN.NOTICE_CONTENT AS "noticeContent",
     DN.INSERT_TIME AS "insertTime",
     DN.INSERT_USERNAME AS "insertUsername",
-    DN.PERMISSION AS "permission"
+    DN.PERMISSION AS "permission",
+    DN.STATUS AS "status",
+    DN.UPDATE_TITLE AS "updateTitle",
+    DN.UPDATE_CONTENT AS "updateContent",
+    DN.UPDATE_TIME AS "updateTime",
+    DN.UPDATE_USERNAME AS "updateUsername"
     FROM DIL_NOTICE DN
     WHERE DN.DELETED !=1 and (DN.PERMISSION='qita' or DN.PERMISSION='chengyunshang')
     <if test="con!=null">
@@ -468,14 +482,18 @@
   <select id="getMarketingNoticeList" parameterType="java.util.Map" resultType="java.util.Map">
   SELECT * FROM
   (
-
   SELECT
   DN.NOTICE_ID AS "noticeId",
   DN.NOTICE_TITLE AS "noticeTitle",
   DN.NOTICE_CONTENT AS "noticeContent",
   DN.INSERT_TIME AS "insertTime",
   DN.INSERT_USERNAME AS "insertUsername",
-  DN.PERMISSION AS "permission"
+  DN.PERMISSION AS "permission",
+  DN.STATUS AS "status",
+  DN.UPDATE_TITLE AS "updateTitle",
+  DN.UPDATE_CONTENT AS "updateContent",
+  DN.UPDATE_TIME AS "updateTime",
+  DN.UPDATE_USERNAME AS "updateUsername"
   FROM DIL_NOTICE DN
   WHERE DN.DELETED !=1 and (DN.PERMISSION='qita' or DN.PERMISSION='wuliuyunshubu')
   <if test="con!=null">
@@ -530,7 +548,12 @@
           DN.NOTICE_CONTENT AS "noticeContent",
           DN.INSERT_TIME AS "insertTime",
           DN.INSERT_USERNAME AS "insertUsername",
-          DN.PERMISSION AS "permission"
+          DN.PERMISSION AS "permission",
+          DN.STATUS AS "status",
+          DN.UPDATE_TITLE AS "updateTitle",
+          DN.UPDATE_CONTENT AS "updateContent",
+          DN.UPDATE_TIME AS "updateTime",
+          DN.UPDATE_USERNAME AS "updateUsername"
         FROM DIL_NOTICE DN
         WHERE DN.DELETED !=1 and (DN.PERMISSION='qita' or DN.PERMISSION='shouhuokehu')
         <if test="con!=null">
@@ -585,11 +608,26 @@
       DN.INSERT_USERNAME AS "insertUsername",
       decode(DN.PERMISSION,'qita','全部可见',
       'chengyunshang','承运商',
-      'wuliuyunshubu','销售',
+      'wuliuyunshubu','销售公司',
       'shouhuokehu','收货客户') "permission"
     FROM DIL_NOTICE DN
     WHERE DN.NOTICE_ID=#{id}
+  </select>
 
+  <!--根据Id查询公告(修改过后的)-->
+  <select id="getNoticeById1" resultType="java.util.LinkedHashMap" >
+    SELECT
+      DN.NOTICE_ID AS "noticeId",
+      DN.UPDATE_TITLE AS "noticeTitle",
+      DN.UPDATE_CONTENT AS "noticeContent",
+      DN.UPDATE_TIME AS "insertTime",
+      DN.UPDATE_USERNAME AS "insertUsername",
+      decode(DN.PERMISSION,'qita','全部可见',
+      'chengyunshang','承运商',
+      'wuliuyunshubu','销售公司',
+      'shouhuokehu','收货客户') "permission"
+    FROM DIL_NOTICE DN
+    WHERE DN.NOTICE_ID=#{id}
   </select>
 
 
@@ -610,18 +648,25 @@
 
   <!--获取信息-->
   <select id="getNoticeData" parameterType="java.lang.String" resultType="java.util.Map">
+    select * from(
     SELECT DN.NOTICE_TITLE AS "noticetitle",
     DN.NOTICE_CONTENT AS "noticecontent",
     DN.INSERT_USERNAME AS "insertusername",
     DN.INSERT_TIME AS "inserttime",
-    (select count(*) from DIL_NOTICE_USERS where STATUS =0
-    and USER_ID=#{userId}) "taskAllNum"
+    DN.NOTICE_ID AS "noticeId",
+    (select count(DNU.NOTICE_ID) from DIL_NOTICE_USERS DNU
+    LEFT JOIN DIL_NOTICE DN
+    ON DN.NOTICE_ID=DNU.NOTICE_ID
+    where DNU.STATUS =0
+    and DNU.USER_ID=#{userId}
+    and DN.INSERT_TIME <![CDATA[<]]> SYSDATE) "taskAllNum"
     FROM DIL_NOTICE_USERS DNU
     LEFT JOIN DIL_NOTICE DN
     ON DN.NOTICE_ID=DNU.NOTICE_ID
     WHERE DNU.USER_ID=#{userId}
     and sysdate > DN.INSERT_TIME
-    order by DN.INSERT_TIME DESC
+    order by DN.INSERT_TIME DESC)
+    where rownum <![CDATA[<]]> 4
   </select>
 
   <!--获取信息-->
@@ -683,7 +728,16 @@
     update DIL_NOTICE_USERS DNU
     SET STATUS=1
     WHERE DNU.USER_ID=#{userId}
+    and DNU.NOTICE_ID=#{noticeId}
   </update>
+  <select id="gettaskAllNum" resultType="java.lang.Integer">
+    select count(DNU.NOTICE_ID) from DIL_NOTICE_USERS DNU
+    LEFT JOIN DIL_NOTICE DN
+    ON DN.NOTICE_ID=DNU.NOTICE_ID
+    where DNU.STATUS =0
+    and DNU.USER_ID=#{userId}
+    and DN.INSERT_TIME <![CDATA[<]]> SYSDATE
+  </select>
   <select id="queryName" resultType="java.lang.String">
     select SU.USER_NAME "userName"
     from "SSO".SYS_USER SU
@@ -692,12 +746,45 @@
   <select id="getorgCode" resultType="java.lang.String">
     select DN.PERMISSION "permission"
     from DIL_NOTICE DN
-    where  DN.NOTICE_ID=#{noticeid}
+    where  DN.NOTICE_ID=#{noticeId}
+  </select>
+
+  <select id="gethistoryorgCode" resultMap="BaseResultMap">
+    select *
+    from DIL_NOTICE DN
+    where  DN.NOTICE_ID=#{noticeId}
   </select>
 
-  <select id="gethistoryorgCode" resultType="java.lang.String">
-    select DN.HISTORICAL_CHANGES "historicalChanges"
+  <update id="updatehistorydata">
+    update DIL_NOTICE
+    set NOTICE_TITLE=#{noticeTitle},
+    NOTICE_CONTENT=#{noticeContent},
+    INSERT_USERNAME=#{insertUsername},
+    INSERT_TIME=#{insertTime},
+    UPDATE_TIME=null,UPDATE_TITLE=null,UPDATE_CONTENT=null,UPDATE_USERNAME=null,STATUS=0
+    WHERE NOTICE_ID=#{noticeId}
+  </update>
+
+  <update id="updateTime">
+    update DIL_NOTICE
+    set INSERT_TIME=#{insertTime}
+    where NOTICE_ID=#{noticeId}
+  </update>
+
+  <update id="modifyData">
+    update DIL_NOTICE
+    set UPDATE_TITLE=#{updateTitle},
+    UPDATE_CONTENT=#{updateContent},
+    UPDATE_USERNAME=#{updateUsername},
+    UPDATE_TIME=#{updateTime},
+    PERMISSION=#{permission},
+    STATUS=#{status}
+    WHERE NOTICE_ID=#{noticeId}
+  </update>
+
+  <select id="getStatus" resultType="java.lang.String">
+    select DN.STATUS "status"
     from DIL_NOTICE DN
-    where  DN.NOTICE_ID=#{noticeid}
+    where  DN.NOTICE_ID=#{id}
   </select>
 </mapper>