瀏覽代碼

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

Your Name 3 年之前
父節點
當前提交
35601eb8a6

+ 269 - 0
src/main/java/com/steerinfo/dil/controller/DilNoticeController.java

@@ -0,0 +1,269 @@
+package com.steerinfo.dil.controller;
+
+import com.alibaba.fastjson.JSON;
+import com.steerinfo.dil.feign.ESFeign;
+import com.steerinfo.dil.model.DilNotice;
+import com.steerinfo.dil.service.IDilNoticeService;
+import com.steerinfo.dil.util.BaseRESTfulController;
+import com.steerinfo.dil.util.ColumnDataUtil;
+import com.steerinfo.dil.util.PageListAdd;
+import com.steerinfo.framework.controller.RESTfulResult;
+import com.steerinfo.framework.service.pagehelper.PageHelper;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.lang.reflect.Parameter;
+import java.util.*;
+import java.math.BigDecimal;
+
+/**
+ * DilNotice RESTful接口:
+ * @author generator
+ * @version 1.0-SNAPSHORT 2021-12-08 02:21
+ * 类描述
+ * 修订历史:
+ * 日期:2021-12-08
+ * 作者:generator
+ * 参考:
+ * 描述:DilNotice RESTful接口
+ * @see null
+ * @Copyright 湖南视拓信息技术股份有限公司. All rights reserved.
+ */
+@RestController
+@RequestMapping("/${api.version}/dilnotices")
+public class DilNoticeController extends BaseRESTfulController {
+
+    @Autowired
+    IDilNoticeService dilNoticeService;
+    @Autowired
+    ColumnDataUtil columnDataUtil;
+    @Autowired
+    ESFeign esFeign;
+
+
+
+
+    /**
+     * 展示公告信息
+     * @param mapVal
+     * @param pageNum
+     * @param pageSize
+     * @param apiId
+     * @return
+     */
+    @ApiOperation(value="获取列表", notes="分页查询")
+    @ApiImplicitParams({
+        @ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"),
+        @ApiImplicitParam(name = "pageSize", value = "每页记录数", required = false, dataType = "Integer"),
+        @ApiImplicitParam(name = "apiId", value = "359", required = false, dataType = "BigDecimal"),
+    })
+    //获取整个的通知日期,标题,发布人
+    @PostMapping(value = "/getNoticeList")
+    public RESTfulResult getNoticeList(@RequestBody(required = false) Map<String,Object> mapVal,
+                                         Integer pageNum,
+                                         Integer pageSize,
+                                         Integer apiId){
+        List<Map<String,Object>> list = dilNoticeService.getNoticeList(mapVal);
+        PageHelper.startPage(pageNum, pageSize);
+        //分页查询数据
+        List<Map<String, Object>> columnList = dilNoticeService.getNoticeList(mapVal);
+        PageListAdd data = columnDataUtil.tableColumnData(apiId, list, columnList);
+        return success(data);
+    }
+
+
+    @ApiOperation(value="获取销售公司通知列表", notes="分页查询")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"),
+            @ApiImplicitParam(name = "pageSize", value = "每页记录数", required = false, dataType = "Integer"),
+            @ApiImplicitParam(name = "apiId", value = "414", required = false, dataType = "BigDecimal"),
+    })
+    //获取整个的通知日期,标题,发布人
+    @PostMapping(value = "/getMarketingNoticeList")
+    public RESTfulResult getMarketingNoticeList(@RequestBody(required = false) Map<String,Object> mapVal,
+                                       Integer pageNum,
+                                       Integer pageSize,
+                                       Integer apiId){
+        List<Map<String,Object>> list = dilNoticeService.getMarketingNoticeList(mapVal);
+        PageHelper.startPage(pageNum, pageSize);
+        //分页查询数据
+        List<Map<String, Object>> columnList = dilNoticeService.getMarketingNoticeList(mapVal);
+        PageListAdd data = columnDataUtil.tableColumnData(apiId, list, columnList);
+        return success(data);
+    }
+
+
+    @ApiOperation(value="获取承运商通知列表", notes="分页查询")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"),
+            @ApiImplicitParam(name = "pageSize", value = "每页记录数", required = false, dataType = "Integer"),
+            @ApiImplicitParam(name = "apiId", value = "414", required = false, dataType = "BigDecimal"),
+    })
+    //获取整个的通知日期,标题,发布人
+    @PostMapping(value = "/getCarrierNoticeList")
+    public RESTfulResult getCarrierNoticeList(@RequestBody(required = false) Map<String,Object> mapVal,
+                                              Integer pageNum,
+                                              Integer pageSize,
+                                              Integer apiId){
+        List<Map<String,Object>> list = dilNoticeService.getCarrierNoticeList(mapVal);
+        PageHelper.startPage(pageNum, pageSize);
+        //分页查询数据
+        List<Map<String, Object>> columnList = dilNoticeService.getCarrierNoticeList(mapVal);
+        PageListAdd data = columnDataUtil.tableColumnData(apiId, list, columnList);
+        return success(data);
+    }
+
+    @ApiOperation(value="获取收获客户通知列表", notes="分页查询")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"),
+            @ApiImplicitParam(name = "pageSize", value = "每页记录数", required = false, dataType = "Integer"),
+            @ApiImplicitParam(name = "apiId", value = "414", required = false, dataType = "BigDecimal"),
+    })
+    //获取整个的通知日期,标题,发布人
+    @PostMapping(value = "/getClientNoticeList")
+    public RESTfulResult getClientNoticeList(@RequestBody(required = false) Map<String,Object> mapVal,
+                                                Integer pageNum,
+                                                Integer pageSize,
+                                                Integer apiId){
+        List<Map<String,Object>> list = dilNoticeService.getClientNoticeList(mapVal);
+        PageHelper.startPage(pageNum, pageSize);
+        //分页查询数据
+        List<Map<String, Object>> columnList = dilNoticeService.getClientNoticeList(mapVal);
+        PageListAdd data = columnDataUtil.tableColumnData(apiId, list, columnList);
+        return success(data);
+    }
+
+
+    /**
+     * 创建通知信息
+     * @param dilNotice
+     * @return
+     */
+    @ApiOperation(value="创建", notes="根据DilNotice对象创建")
+    @ApiImplicitParam(name = "dilNotice", value = "详细实体dilNotice", required = true, dataType = "DilNotice")
+    @PostMapping(value = "/insertNotice")
+    public RESTfulResult insertNotice(@RequestBody DilNotice dilNotice){
+        int result = dilNoticeService.insertNotice(dilNotice);
+        return success(result);
+    }
+
+
+
+    /**
+     * 根据id更新通知信息
+     * @param dilNotice
+     * @return
+     */
+    @ApiOperation(value="更新通知信息", notes="根据url的id来指定更新对象,并根据传过来的dilNotice信息来更新详细信息")
+    @ApiImplicitParams({
+            @ApiImplicitParam(paramType = "path", name = "id", value = "ID", required = true, dataType = "Short"),
+            @ApiImplicitParam(name = "dilNotice", value = "详细实体dilNotice", required = true, dataType = "DilNotice")
+    })
+    @PostMapping(value = "/updateNotice", produces  = "application/json;charset=UTF-8")
+    public RESTfulResult updateNotice( @RequestBody DilNotice dilNotice){
+        int result = dilNoticeService.updateNotice(dilNotice);
+        return success(result);
+    }
+
+
+    /**
+     * 根据id删除通知信息
+     * @param id
+     * @return
+     */
+    @ApiOperation(value="删除", notes="根据url的id来指定删除对象")
+    @ApiImplicitParam(paramType = "path", name = "id", value = "ID", required = true, dataType = "Short")
+    @PostMapping(value = "/deleteNotice/{id}")
+    public RESTfulResult deleteNotice(@PathVariable("id") BigDecimal id){
+        return success(dilNoticeService.deleteNotice(id));
+    }
+
+
+
+    /**
+     * 根据id获取通知信息
+     * @param id
+     * @return
+     */
+    @ApiOperation(value="获取通知详细信息", notes="根据url的id来获取详细信息")
+    @ApiImplicitParam(paramType = "path", name = "id", value = "ID", required = true, dataType = "BigDecimal")
+    @PostMapping(value = "/getNoticeById/{id}")
+    public RESTfulResult getNoticeById(@PathVariable("id") BigDecimal id){
+        List<Map<String,Object>> list= dilNoticeService.getNoticeById(id);
+        return success(list);
+    }
+
+    /**
+     * 根据permissions获取最新通知信息
+     * @param permissions
+     * @return
+     */
+    @ApiOperation(value="获取通知详细信息", notes="根据url的id来获取详细信息")
+    @ApiImplicitParam(paramType = "path", name = "permission", value = "permission", required = true, dataType = "String")
+    @PostMapping(value = "/getNewNoticeByPermission/{permissions}")
+    public RESTfulResult getNewNoticeByPermission(@PathVariable("permissions")String permissions){
+        BigDecimal permission=new BigDecimal(permissions);
+        List<Map<String,Object>> list= dilNoticeService.getNewNoticeByPermission(permission);
+        return success(list);
+    }
+
+
+
+
+    @ApiOperation(value = "模糊查询通知信息", notes = "分页查询")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"),
+            @ApiImplicitParam(name = "pageSize", value = "每页记录数", required = false, dataType = "Integer"),
+            @ApiImplicitParam(name = "apiId", value = "196", required = false, dataType = "BigDecimal"),
+    })
+    @PostMapping(value = "/getNoticeResultList")
+    public RESTfulResult getNoticeResultList(@RequestBody(required = false) Map<String, Object> mapValue,
+                                               Integer apiId,
+                                               Integer pageNum,
+                                               Integer pageSize,
+                                               String con) {
+        if (mapValue==null){
+            mapValue=new HashMap<>();
+        }
+        //框计算
+        if (con != null) {
+            if (!"undefined".equals(con)) {
+                //设置要查询的索引名称
+                String index = "get_notice_list";
+                //获取查询结果
+                return success(esFeign.getConResult(mapValue, index, apiId, pageNum, pageSize, con));
+            }
+        }
+        //初始化过滤
+        List<Map<String, Object>> listTotal = null;
+        //如果有条件查询则跳过初始化,和创建索引
+        if (mapValue.size() == 0) {
+            //将查询结果存入索引中
+            listTotal = dilNoticeService.getNoticeList(null);
+            Map<String, Object> map = new HashMap<>();
+            //添加索引
+            map.put("index", "get_notice_list");
+            //添加id
+            map.put("indexId", "noticeId");
+            listTotal.add(map);
+            //新建索引
+            String s = JSON.toJSONString(listTotal);
+            esFeign.insertIndex(listTotal);
+            //删除
+            listTotal.remove(listTotal.size() - 1);
+        }
+        if (listTotal == null) {
+            listTotal = dilNoticeService.getNoticeList(mapValue);
+        }
+        PageHelper.startPage(pageNum, pageSize);
+        //分页查询数据
+        List<Map<String, Object>> columnList = dilNoticeService.getNoticeList(mapValue);
+        PageListAdd data = columnDataUtil.tableColumnData(apiId, listTotal, columnList);
+        return success(data);
+    }
+
+
+}

+ 32 - 0
src/main/java/com/steerinfo/dil/mapper/DilNoticeMapper.java

@@ -0,0 +1,32 @@
+package com.steerinfo.dil.mapper;
+
+import com.steerinfo.dil.model.DilNotice;
+import com.steerinfo.framework.mapper.IBaseMapper;
+import java.math.*;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Select;
+
+@Mapper
+public interface DilNoticeMapper extends IBaseMapper<DilNotice, BigDecimal> {
+
+    List<Map<String, Object>> getNoticeList(Map<String, Object> mapVal);
+
+    //承运商查看公告
+    List<Map<String, Object>> getCarrierNoticeList(Map<String, Object> mapVal);
+
+    //id自增
+    @Select("select seq_DIL_NOTICE.nextval from dual")
+    BigDecimal selectNoticeId();
+
+    List<Map<String, Object>> getNoticeById(BigDecimal id);
+
+    //销售公司查看公告
+    List<Map<String, Object>> getMarketingNoticeList(Map<String, Object> mapVal);
+    //收货客户查看公告
+    List<Map<String, Object>> getClientNoticeList(Map<String, Object> mapVal);
+    //根据不同的用户发放不同的最新消息
+    List<Map<String, Object>> getNewNoticeByPermission(BigDecimal permission);
+}

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

@@ -0,0 +1,199 @@
+package com.steerinfo.dil.model;
+
+import com.steerinfo.framework.model.IBasePO;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+@ApiModel(value="面向承运商发布通知")
+public class DilNotice implements IBasePO<BigDecimal> {
+    /**
+     * 通知ID(NOTICE_ID,DECIMAL,38)
+     */
+    @ApiModelProperty(value="通知ID",required=true)
+    private BigDecimal noticeId;
+
+    /**
+     * 通知标题(NOTICE_TITLE,VARCHAR,20)
+     */
+    @ApiModelProperty(value="通知标题",required=false)
+    private String noticeTitle;
+
+    /**
+     * 通知内容(NOTICE_CONTENT,VARCHAR,500)
+     */
+    @ApiModelProperty(value="通知内容",required=false)
+    private String noticeContent;
+
+    /**
+     * 记录创建人(INSERT_USERNAME,VARCHAR,20)
+     */
+    @ApiModelProperty(value="记录创建人",required=false)
+    private String insertUsername;
+
+    /**
+     * 记录创建时间(INSERT_TIME,TIMESTAMP,7)
+     */
+    @ApiModelProperty(value="记录创建时间",required=false)
+    private Date insertTime;
+
+    /**
+     * 记录修改人(UPDATE_USERNAME,VARCHAR,20)
+     */
+    @ApiModelProperty(value="记录修改人",required=false)
+    private String updateUsername;
+
+    /**
+     * 记录修改时间(UPDATE_TIME,TIMESTAMP,7)
+     */
+    @ApiModelProperty(value="记录修改时间",required=false)
+    private Date updateTime;
+
+    /**
+     * 记录创建或修改备注(INSERT_UPDATE_REMARK,VARCHAR,100)
+     */
+    @ApiModelProperty(value="记录创建或修改备注",required=false)
+    private String insertUpdateRemark;
+
+    /**
+     * 状态(DELETED,DECIMAL,38)
+     */
+    @ApiModelProperty(value="状态",required=false)
+    private BigDecimal deleted;
+
+
+    /**
+     * 查看权限状态码(PERMISSION,DECIMAL,38)
+     */
+    @ApiModelProperty(value="查看权限状态码",required=false)
+    private BigDecimal permission;
+
+    /**
+     * 查看权限状态描述(PERMISSION,DECIMAL,38)
+     */
+    @ApiModelProperty(value="查看权限状态码描述",required=false)
+    private String permissions;
+
+    private static final long serialVersionUID = 1L;
+
+    @Override
+    public BigDecimal getId() {
+        return this.noticeId;
+    }
+
+    @Override
+    public void setId(BigDecimal noticeId) {
+        this.noticeId = noticeId;
+    }
+
+    public BigDecimal getNoticeId() {
+        return noticeId;
+    }
+
+    public void setNoticeId(BigDecimal noticeId) {
+        this.noticeId = noticeId;
+    }
+
+    public String getNoticeTitle() {
+        return noticeTitle;
+    }
+
+    public void setNoticeTitle(String noticeTitle) {
+        this.noticeTitle = noticeTitle == null ? null : noticeTitle.trim();
+    }
+
+    public String getNoticeContent() {
+        return noticeContent;
+    }
+
+    public void setNoticeContent(String noticeContent) {
+        this.noticeContent = noticeContent == null ? null : noticeContent.trim();
+    }
+
+    public String getInsertUsername() {
+        return insertUsername;
+    }
+
+    public void setInsertUsername(String insertUsername) {
+        this.insertUsername = insertUsername == null ? null : insertUsername.trim();
+    }
+
+    public Date getInsertTime() {
+        return insertTime;
+    }
+
+    public void setInsertTime(Date insertTime) {
+        this.insertTime = insertTime;
+    }
+
+    public String getUpdateUsername() {
+        return updateUsername;
+    }
+
+    public void setUpdateUsername(String updateUsername) {
+        this.updateUsername = updateUsername == null ? null : updateUsername.trim();
+    }
+
+    public Date getUpdateTime() {
+        return updateTime;
+    }
+
+    public void setUpdateTime(Date updateTime) {
+        this.updateTime = updateTime;
+    }
+
+    public String getInsertUpdateRemark() {
+        return insertUpdateRemark;
+    }
+
+    public void setInsertUpdateRemark(String insertUpdateRemark) {
+        this.insertUpdateRemark = insertUpdateRemark == null ? null : insertUpdateRemark.trim();
+    }
+
+    public BigDecimal getDeleted() {
+        return deleted;
+    }
+
+    public void setDeleted(BigDecimal deleted) {
+        this.deleted = deleted;
+    }
+
+    public BigDecimal getPermission() {
+        return permission;
+    }
+
+    public void setPermission(BigDecimal permission) {
+        this.permission = permission;
+    }
+
+    public String getPermissions() {
+        return permissions;
+    }
+    public void setPermissions(String permissions) {
+        this.permissions = permissions;
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder sb = new StringBuilder();
+        sb.append(getClass().getSimpleName());
+        sb.append(" [");
+        sb.append("Hash = ").append(hashCode());
+        sb.append(", noticeId=").append(noticeId);
+        sb.append(", noticeTitle=").append(noticeTitle);
+        sb.append(", noticeContent=").append(noticeContent);
+        sb.append(", insertUsername=").append(insertUsername);
+        sb.append(", insertTime=").append(insertTime);
+        sb.append(", updateUsername=").append(updateUsername);
+        sb.append(", updateTime=").append(updateTime);
+        sb.append(", insertUpdateRemark=").append(insertUpdateRemark);
+        sb.append(", deleted=").append(deleted);
+        sb.append(", permission=").append(permission);
+        sb.append(", permissions=").append(permissions);
+        sb.append(", serialVersionUID=").append(serialVersionUID);
+        sb.append("]");
+        return sb.toString();
+    }
+}

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

@@ -0,0 +1,46 @@
+package com.steerinfo.dil.service;
+
+import com.steerinfo.dil.model.DilNotice;
+
+import java.math.BigDecimal;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * DilNotice服务接口:
+ * @author generator
+ * @version 1.0-SNAPSHORT 2021-12-08 02:21
+ * 类描述
+ * 修订历史:
+ * 日期:2021-12-08
+ * 作者:generator
+ * 参考:
+ * 描述:DilNotice服务接口
+ * @see null
+ * @Copyright 湖南视拓信息技术股份有限公司. All rights reserved.
+ */
+public interface IDilNoticeService {
+
+    List<Map<String, Object>> getNoticeList(Map<String, Object> mapVal);
+
+    int insertNotice(DilNotice dilNotice);
+
+    int updateNotice(DilNotice dilNotice);
+
+    int deleteNotice(BigDecimal id);
+
+    List<Map<String, Object>> getNoticeById(BigDecimal id);
+
+    List<Map<String, Object>> getCarrierNoticeList(Map<String, Object> mapVal);
+
+    List<Map<String, Object>> getMarketingNoticeList(Map<String, Object> mapVal);
+
+    List<Map<String, Object>> getClientNoticeList(Map<String, Object> mapVal);
+
+    List<Map<String, Object>> getNewNoticeByPermission(BigDecimal permission);
+
+/*    List<Map<String,Object>> getCapacityTypeId();
+
+    List<Map<String,Object>> getCarrierId();*/
+
+}

+ 152 - 0
src/main/java/com/steerinfo/dil/service/impl/DilNoticeServiceImpl.java

@@ -0,0 +1,152 @@
+package com.steerinfo.dil.service.impl;
+
+import com.steerinfo.dil.mapper.DilNoticeMapper;
+import com.steerinfo.dil.model.DilNotice;
+import com.steerinfo.dil.service.IDilNoticeService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import java.util.Date;
+import java.math.BigDecimal;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * DilNotice服务实现:
+ * @author generator
+ * @version 1.0-SNAPSHORT 2021-12-08 02:21
+ * 类描述
+ * 修订历史:
+ * 日期:2021-12-08
+ * 作者:generator
+ * 参考:
+ * 描述:DilNotice服务实现
+ * @see null
+ * @Copyright 湖南视拓信息技术股份有限公司. All rights reserved.
+ */
+@Service(value = "dilNoticeService")
+public class DilNoticeServiceImpl  implements IDilNoticeService {
+    @Autowired
+    private DilNoticeMapper dilNoticeMapper;
+
+
+    /**
+     * 获取通知信息
+     * */
+    @Override
+    public List<Map<String, Object>> getNoticeList(Map<String, Object> mapVal) {
+        return dilNoticeMapper.getNoticeList(mapVal);
+    }
+
+    /**
+     * 承运商获取通知信息
+     * */
+    @Override
+    public List<Map<String, Object>> getCarrierNoticeList(Map<String, Object> mapVal) {
+        return dilNoticeMapper.getCarrierNoticeList(mapVal);
+    }
+
+    /**
+     * 销售公司获取通知信息
+     * */
+    @Override
+    public List<Map<String, Object>> getMarketingNoticeList(Map<String, Object> mapVal) {
+        return dilNoticeMapper.getMarketingNoticeList(mapVal);
+    }
+
+
+    /**
+     * 收货用户获取通知信息
+     * */
+
+    @Override
+    public List<Map<String, Object>> getClientNoticeList(Map<String, Object> mapVal) {
+        return dilNoticeMapper.getClientNoticeList(mapVal);
+    }
+
+
+    @Override
+    public List<Map<String, Object>> getNewNoticeByPermission(BigDecimal permission) {
+        return dilNoticeMapper.getNewNoticeByPermission(permission);
+    }
+
+    /**
+     * 增加通知信息
+     * */
+
+    @Override
+    /*这里是解决前端毛病所妥协的结果,前端拿不到value值,只能拿到name也就是key值,这里在后端强行将key转为value值QAQ*/
+    public int insertNotice(DilNotice dilNotice) {
+        dilNotice.setDeleted(new BigDecimal(0));
+        dilNotice.setInsertTime(new Date());
+        if(dilNotice.getPermissions()!=null){
+            if(dilNotice.getPermissions().equals("承运商")){
+                dilNotice.setPermission(BigDecimal.valueOf(1));
+            }
+            else if(dilNotice.getPermissions().equals("销售商")){
+                dilNotice.setPermission(BigDecimal.valueOf(2));
+            }
+            else if(dilNotice.getPermissions().equals("收货客户")){
+                dilNotice.setPermission(BigDecimal.valueOf(3));
+            }
+        }
+
+        {
+
+        }
+        //需要手动设置发布人
+        /*dilNotice.setInsertUsername("admin");*/
+        dilNotice.setNoticeId(dilNoticeMapper.selectNoticeId());
+        return dilNoticeMapper.insertSelective(dilNotice);
+    }
+
+    /**
+     * 修改通知信息
+     * */
+    @Override
+    public int updateNotice(DilNotice dilNotice) {
+        /*dilNotice.setUpdateTime(new Date());*/
+        /*dilNotice.setUpdateUsername("admin");*/
+        return dilNoticeMapper.updateByPrimaryKeySelective(dilNotice);
+    }
+
+    /**
+     * 删除通知信息
+     * */
+    @Override
+    public int deleteNotice(BigDecimal id) {
+        DilNotice dilNotice = dilNoticeMapper.selectByPrimaryKey(id);
+        dilNotice.setDeleted(new BigDecimal(1));
+        return dilNoticeMapper.updateByPrimaryKeySelective(dilNotice);
+    }
+
+    /**
+     * 根据id获取运力信息
+     * @param id
+     * @return
+     */
+    @Override
+    public List<Map<String, Object>> getNoticeById(BigDecimal id) {
+        return dilNoticeMapper.getNoticeById(id);
+    }
+
+
+
+    /*
+     * 获取下拉框
+     * */
+/*
+    @Override
+    public  List<Map<String,Object>> getCapacityTypeId() {
+        return rmsCapacityMapper.getCapacityTypeId();
+    }
+
+    @Override
+    public List<Map<String, Object>> getCarrierId() {
+        return rmsCapacityMapper.getCarrierId();
+    }
+*/
+
+
+
+
+}

+ 2 - 2
src/main/resources/application-dev.yml

@@ -1,8 +1,8 @@
 spring:
   datasource:
     url: jdbc:oracle:thin:@172.16.33.163:1521:ilsdbpri
-    password: root123
-    username: dagang
+    password: Dil123789
+    username: dil
     driver-class-name: oracle.jdbc.OracleDriver
   application:
     name: dil-ams-api-dev

+ 2 - 2
src/main/resources/application-prod.yml

@@ -1,8 +1,8 @@
 spring:
   datasource:
     url: jdbc:oracle:thin:@172.16.33.163:1521:ilsdbpri
-    password: root123
-    username: dagang
+    password: Dil123789
+    username: dil
     driver-class-name: oracle.jdbc.OracleDriver
   application:
     name: dil-ams-api-dev

+ 8 - 8
src/main/resources/bootstrap.yml

@@ -14,16 +14,16 @@ spring:
 
 openfeign:
 #   正式环境
-#  ESFeign:
-#    url: ${ESFEIGN_URL:172.16.33.166:8089}
-#  ColumnDataFeign:
-#    url: ${COLUMNDATAFEIGN_URL:172.16.33.166:8083}
-
-#   测试环境
   ESFeign:
-    url: ${ESFEIGN_URL:172.16.33.162:8011}
+    url: ${ESFEIGN_URL:172.16.33.166:8089}
   ColumnDataFeign:
-    url: ${COLUMNDATAFEIGN_URL:172.16.33.162:8001}
+    url: ${COLUMNDATAFEIGN_URL:172.16.33.166:8083}
+
+#   测试环境
+#  ESFeign:
+#    url: ${ESFEIGN_URL:172.16.33.162:8011}
+#  ColumnDataFeign:
+#    url: ${COLUMNDATAFEIGN_URL:172.16.33.162:8001}
 
 #eureka设置
 eureka:

+ 512 - 0
src/main/resources/com/steerinfo/dil/mapper/DilNoticeMapper.xml

@@ -0,0 +1,512 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.steerinfo.dil.mapper.DilNoticeMapper">
+  <resultMap id="BaseResultMap" type="com.steerinfo.dil.model.DilNotice">
+    <id column="NOTICE_ID" jdbcType="DECIMAL" property="noticeId" />
+    <result column="NOTICE_TITLE" jdbcType="VARCHAR" property="noticeTitle" />
+    <result column="NOTICE_CONTENT" jdbcType="VARCHAR" property="noticeContent" />
+    <result column="INSERT_USERNAME" jdbcType="VARCHAR" property="insertUsername" />
+    <result column="INSERT_TIME" jdbcType="TIMESTAMP" property="insertTime" />
+    <result column="UPDATE_USERNAME" jdbcType="VARCHAR" property="updateUsername" />
+    <result column="UPDATE_TIME" jdbcType="TIMESTAMP" property="updateTime" />
+    <result column="INSERT_UPDATE_REMARK" jdbcType="VARCHAR" property="insertUpdateRemark" />
+    <result column="DELETED" jdbcType="DECIMAL" property="deleted" />
+    <result column="PERMISSION" jdbcType="DECIMAL" property="permission" />
+  </resultMap>
+  <sql id="columns">
+    NOTICE_ID, NOTICE_TITLE, NOTICE_CONTENT, INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME, 
+    UPDATE_TIME, INSERT_UPDATE_REMARK, DELETED, PERMISSION
+  </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
+  </sql>
+  <sql id="select">
+    SELECT <include refid="columns"/> FROM DIL_NOTICE
+  </sql>
+  <sql id="select_alias">
+    SELECT <include refid="columns_alias"/> FROM DIL_NOTICE t
+  </sql>
+  <sql id="where">
+    <where> 
+      <if test="noticeId != null">
+        and NOTICE_ID = #{noticeId}
+      </if>
+      <if test="noticeTitle != null and noticeTitle != ''">
+        and NOTICE_TITLE = #{noticeTitle}
+      </if>
+      <if test="noticeContent != null and noticeContent != ''">
+        and NOTICE_CONTENT = #{noticeContent}
+      </if>
+      <if test="insertUsername != null and insertUsername != ''">
+        and INSERT_USERNAME = #{insertUsername}
+      </if>
+      <if test="insertTime != null">
+        and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
+      </if>
+      <if test="updateUsername != null and updateUsername != ''">
+        and UPDATE_USERNAME = #{updateUsername}
+      </if>
+      <if test="updateTime != null">
+        and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
+      </if>
+      <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
+        and INSERT_UPDATE_REMARK = #{insertUpdateRemark}
+      </if>
+      <if test="deleted != null">
+        and DELETED = #{deleted}
+      </if>
+      <if test="permission != null">
+        and PERMISSION = #{permission}
+      </if>
+    </where>
+  </sql>
+  <sql id="whereLike">
+    <where> 
+      <if test="noticeId != null">
+        and NOTICE_ID = #{noticeId}
+      </if>
+      <if test="noticeTitle != null and noticeTitle != ''">
+        and NOTICE_TITLE LIKE '%${noticeTitle}%'
+      </if>
+      <if test="noticeContent != null and noticeContent != ''">
+        and NOTICE_CONTENT LIKE '%${noticeContent}%'
+      </if>
+      <if test="insertUsername != null and insertUsername != ''">
+        and INSERT_USERNAME LIKE '%${insertUsername}%'
+      </if>
+      <if test="insertTime != null">
+        and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
+      </if>
+      <if test="updateUsername != null and updateUsername != ''">
+        and UPDATE_USERNAME LIKE '%${updateUsername}%'
+      </if>
+      <if test="updateTime != null">
+        and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
+      </if>
+      <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
+        and INSERT_UPDATE_REMARK LIKE '%${insertUpdateRemark}%'
+      </if>
+      <if test="deleted != null">
+        and DELETED = #{deleted}
+      </if>
+      <if test="permission != null">
+        and PERMISSION = #{permission}
+      </if>
+    </where>
+  </sql>
+  <delete id="deleteByPrimaryKey" parameterType="java.math.BigDecimal">
+    delete from DIL_NOTICE
+    where NOTICE_ID = #{noticeId,jdbcType=DECIMAL}
+  </delete>
+  <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
+    delete from DIL_NOTICE
+    where 1!=1 
+      <if test="noticeTitle != null and noticeTitle != ''">
+        or NOTICE_TITLE = #{noticeTitle}
+      </if>
+      <if test="noticeContent != null and noticeContent != ''">
+        or NOTICE_CONTENT = #{noticeContent}
+      </if>
+      <if test="insertUsername != null and insertUsername != ''">
+        or INSERT_USERNAME = #{insertUsername}
+      </if>
+      <if test="insertTime != null">
+        or TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = '#{insertTime}'
+      </if>
+      <if test="updateUsername != null and updateUsername != ''">
+        or UPDATE_USERNAME = #{updateUsername}
+      </if>
+      <if test="updateTime != null">
+        or TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = '#{updateTime}'
+      </if>
+      <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
+        or INSERT_UPDATE_REMARK = #{insertUpdateRemark}
+      </if>
+      <if test="deleted != null">
+        or DELETED = #{deleted}
+      </if>
+      <if test="permission != null">
+        or PERMISSION = #{permission}
+      </if>
+  </delete>
+  <insert id="insert" parameterType="com.steerinfo.dil.model.DilNotice">
+    insert into DIL_NOTICE (NOTICE_ID, NOTICE_TITLE, NOTICE_CONTENT, 
+      INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME, 
+      UPDATE_TIME, INSERT_UPDATE_REMARK, DELETED, 
+      PERMISSION)
+    values (#{noticeId,jdbcType=DECIMAL}, #{noticeTitle,jdbcType=VARCHAR}, #{noticeContent,jdbcType=VARCHAR}, 
+      #{insertUsername,jdbcType=VARCHAR}, #{insertTime,jdbcType=TIMESTAMP}, #{updateUsername,jdbcType=VARCHAR}, 
+      #{updateTime,jdbcType=TIMESTAMP}, #{insertUpdateRemark,jdbcType=VARCHAR}, #{deleted,jdbcType=DECIMAL}, 
+      #{permission,jdbcType=DECIMAL})
+  </insert>
+  <insert id="insertSelective" parameterType="com.steerinfo.dil.model.DilNotice">
+    insert into DIL_NOTICE
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="noticeId != null">
+        NOTICE_ID,
+      </if>
+      <if test="noticeTitle != null">
+        NOTICE_TITLE,
+      </if>
+      <if test="noticeContent != null">
+        NOTICE_CONTENT,
+      </if>
+      <if test="insertUsername != null">
+        INSERT_USERNAME,
+      </if>
+      <if test="insertTime != null">
+        INSERT_TIME,
+      </if>
+      <if test="updateUsername != null">
+        UPDATE_USERNAME,
+      </if>
+      <if test="updateTime != null">
+        UPDATE_TIME,
+      </if>
+      <if test="insertUpdateRemark != null">
+        INSERT_UPDATE_REMARK,
+      </if>
+      <if test="deleted != null">
+        DELETED,
+      </if>
+      <if test="permission != null">
+        PERMISSION,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="noticeId != null">
+        #{noticeId,jdbcType=DECIMAL},
+      </if>
+      <if test="noticeTitle != null">
+        #{noticeTitle,jdbcType=VARCHAR},
+      </if>
+      <if test="noticeContent != null">
+        #{noticeContent,jdbcType=VARCHAR},
+      </if>
+      <if test="insertUsername != null">
+        #{insertUsername,jdbcType=VARCHAR},
+      </if>
+      <if test="insertTime != null">
+        #{insertTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="updateUsername != null">
+        #{updateUsername,jdbcType=VARCHAR},
+      </if>
+      <if test="updateTime != null">
+        #{updateTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="insertUpdateRemark != null">
+        #{insertUpdateRemark,jdbcType=VARCHAR},
+      </if>
+      <if test="deleted != null">
+        #{deleted,jdbcType=DECIMAL},
+      </if>
+      <if test="permission != null">
+        #{permission,jdbcType=DECIMAL},
+      </if>
+    </trim>
+  </insert>
+  <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.DilNotice">
+    update DIL_NOTICE
+    set NOTICE_TITLE = #{noticeTitle,jdbcType=VARCHAR},
+      NOTICE_CONTENT = #{noticeContent,jdbcType=VARCHAR},
+      INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
+      INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
+      UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
+      UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
+      INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
+      DELETED = #{deleted,jdbcType=DECIMAL},
+      PERMISSION = #{permission,jdbcType=DECIMAL}
+    where NOTICE_ID = #{noticeId,jdbcType=DECIMAL}
+  </update>
+  <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.DilNotice">
+    update DIL_NOTICE
+    <set>
+      <if test="noticeTitle != null">
+        NOTICE_TITLE = #{noticeTitle,jdbcType=VARCHAR},
+      </if>
+      <if test="noticeContent != null">
+        NOTICE_CONTENT = #{noticeContent,jdbcType=VARCHAR},
+      </if>
+      <if test="insertUsername != null">
+        INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
+      </if>
+      <if test="insertTime != null">
+        INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="updateUsername != null">
+        UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
+      </if>
+      <if test="updateTime != null">
+        UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="insertUpdateRemark != null">
+        INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
+      </if>
+      <if test="deleted != null">
+        DELETED = #{deleted,jdbcType=DECIMAL},
+      </if>
+      <if test="permission != null">
+        PERMISSION = #{permission,jdbcType=DECIMAL},
+      </if>
+    </set>
+    where NOTICE_ID = #{noticeId,jdbcType=DECIMAL}
+  </update>
+  <select id="selectByPrimaryKey" parameterType="java.math.BigDecimal" resultMap="BaseResultMap">
+    <include refid="select"/>
+    where NOTICE_ID = #{noticeId,jdbcType=DECIMAL}
+  </select>
+  <select id="selectByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
+    <include refid="select"/>
+    <include refid="where"/>
+  </select>
+  <select id="selectLikeByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
+    <include refid="select"/>
+    <include refid="whereLike"/>
+  </select>
+  <insert id="batchInsert" parameterType="java.util.List">
+    insert into DIL_NOTICE 
+      (NOTICE_ID, 
+      NOTICE_TITLE, NOTICE_CONTENT, INSERT_USERNAME, 
+      INSERT_TIME, UPDATE_USERNAME, 
+      UPDATE_TIME, INSERT_UPDATE_REMARK, 
+      DELETED, PERMISSION)
+    ( <foreach collection="list" item="item" separator="union all"> 
+   select  
+      #{item.noticeId,jdbcType=DECIMAL}, 
+      #{item.noticeTitle,jdbcType=VARCHAR}, #{item.noticeContent,jdbcType=VARCHAR}, #{item.insertUsername,jdbcType=VARCHAR}, 
+      #{item.insertTime,jdbcType=TIMESTAMP}, #{item.updateUsername,jdbcType=VARCHAR}, 
+      #{item.updateTime,jdbcType=TIMESTAMP}, #{item.insertUpdateRemark,jdbcType=VARCHAR}, 
+      #{item.deleted,jdbcType=DECIMAL}, #{item.permission,jdbcType=DECIMAL} from dual  
+   </foreach> )
+  </insert>
+  <update id="batchUpdate" parameterType="java.util.List">
+     update DIL_NOTICE
+     set
+       NOTICE_ID=
+       <foreach collection="list" item="item" index="index" separator=" " open="case NOTICE_ID" close="end">
+          when #{item.noticeId,jdbcType=DECIMAL} then #{item.noticeId,jdbcType=DECIMAL}
+       </foreach>
+       ,NOTICE_TITLE=
+       <foreach collection="list" item="item" index="index" separator=" " open="case NOTICE_ID" close="end">
+          when #{item.noticeId,jdbcType=DECIMAL} then #{item.noticeTitle,jdbcType=VARCHAR}
+       </foreach>
+       ,NOTICE_CONTENT=
+       <foreach collection="list" item="item" index="index" separator=" " open="case NOTICE_ID" close="end">
+          when #{item.noticeId,jdbcType=DECIMAL} then #{item.noticeContent,jdbcType=VARCHAR}
+       </foreach>
+       ,INSERT_USERNAME=
+       <foreach collection="list" item="item" index="index" separator=" " open="case NOTICE_ID" close="end">
+          when #{item.noticeId,jdbcType=DECIMAL} then #{item.insertUsername,jdbcType=VARCHAR}
+       </foreach>
+       ,INSERT_TIME=
+       <foreach collection="list" item="item" index="index" separator=" " open="case NOTICE_ID" close="end">
+          when #{item.noticeId,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=TIMESTAMP}
+       </foreach>
+       ,UPDATE_USERNAME=
+       <foreach collection="list" item="item" index="index" separator=" " open="case NOTICE_ID" close="end">
+          when #{item.noticeId,jdbcType=DECIMAL} then #{item.updateUsername,jdbcType=VARCHAR}
+       </foreach>
+       ,UPDATE_TIME=
+       <foreach collection="list" item="item" index="index" separator=" " open="case NOTICE_ID" close="end">
+          when #{item.noticeId,jdbcType=DECIMAL} then #{item.updateTime,jdbcType=TIMESTAMP}
+       </foreach>
+       ,INSERT_UPDATE_REMARK=
+       <foreach collection="list" item="item" index="index" separator=" " open="case NOTICE_ID" close="end">
+          when #{item.noticeId,jdbcType=DECIMAL} then #{item.insertUpdateRemark,jdbcType=VARCHAR}
+       </foreach>
+       ,DELETED=
+       <foreach collection="list" item="item" index="index" separator=" " open="case NOTICE_ID" close="end">
+          when #{item.noticeId,jdbcType=DECIMAL} then #{item.deleted,jdbcType=DECIMAL}
+       </foreach>
+       ,PERMISSION=
+       <foreach collection="list" item="item" index="index" separator=" " open="case NOTICE_ID" close="end">
+          when #{item.noticeId,jdbcType=DECIMAL} then #{item.permission,jdbcType=DECIMAL}
+       </foreach>
+     where NOTICE_ID in 
+     <foreach collection="list" index="index" item="item" separator="," open="(" close=")">
+    #{item.noticeId,jdbcType=DECIMAL}
+     </foreach> 
+  </update>
+  <delete id="batchDelete" parameterType="java.util.List">
+    delete from DIL_NOTICE
+    where NOTICE_ID in 
+    <foreach collection="list" item="id" open="(" close=")" separator=",">
+      #{id}
+    </foreach>
+  </delete>
+  <!-- 友情提示!!!-->
+  <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
+
+  <!-- 信息列表 -->
+  <select id="getNoticeList" 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"
+    FROM DIL_NOTICE DN
+    WHERE DN.DELETED !=1
+    ORDER BY DN.INSERT_TIME DESC
+    )
+    <where>
+      <if test="noticeId!= null">
+        and
+        <foreach collection="noticeId" item="item" open="(" separator="," close=")">
+          "noticeId" in #{item}
+        </foreach>
+      </if>
+      <if test="noticeTitle!= null">
+        and
+        <foreach collection="noticeTitle" item="item" open="(" separator="," close=")">
+          "noticeTitle" in #{item}
+        </foreach>
+      </if>
+      <if test="noticeContent!= null">
+        and
+        <foreach collection="noticeContent" item="item" open="(" separator="," close=")">
+          "noticeContent" in #{item}
+        </foreach>
+      </if>
+      <if test="insertTime!= null">
+        and
+        <foreach collection="insertTime" item="item" open="(" separator="," close=")">
+          "insertTime" in #{item}
+        </foreach>
+      </if>
+
+      <if test="insertUsername!= null">
+        and
+        <foreach collection="insertUsername" item="item" open="(" separator="," close=")">
+          "insertUsername" in #{item}
+        </foreach>
+      </if>
+
+    </where>
+
+  </select>
+
+  <!--承运商查询通知-->
+  <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"
+    FROM DIL_NOTICE DN
+    WHERE DN.DELETED !=1 and (DN.PERMISSION=0 or DN.PERMISSION=1)
+    ORDER BY DN.INSERT_TIME DESC
+    )
+    <where>
+      <if test="noticeId!= null">
+        and
+        <foreach collection="noticeId" item="item" open="(" separator="," close=")">
+          "noticeId" in #{item}
+        </foreach>
+      </if>
+      <if test="noticeTitle!= null">
+        and
+        <foreach collection="noticeTitle" item="item" open="(" separator="," close=")">
+          "noticeTitle" in #{item}
+        </foreach>
+      </if>
+      <if test="noticeContent!= null">
+        and
+        <foreach collection="noticeContent" item="item" open="(" separator="," close=")">
+          "noticeContent" in #{item}
+        </foreach>
+      </if>
+      <if test="insertTime!= null">
+        and
+        <foreach collection="insertTime" item="item" open="(" separator="," close=")">
+          "insertTime" in #{item}
+        </foreach>
+      </if>
+
+      <if test="insertUsername!= null">
+        and
+        <foreach collection="insertUsername" item="item" open="(" separator="," close=")">
+          "insertUsername" in #{item}
+        </foreach>
+      </if>
+
+    </where>
+
+  </select>
+
+
+  <!--销售公司查询通知-->
+  <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"
+  FROM DIL_NOTICE DN
+  WHERE DN.DELETED !=1 and (DN.PERMISSION=0 or DN.PERMISSION=2)
+  ORDER BY DN.INSERT_TIME DESC
+  )
+  </select>
+
+  <!--收货用户查询通知-->
+  <select id="getClientNoticeList" 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"
+        FROM DIL_NOTICE DN
+        WHERE DN.DELETED !=1 and (DN.PERMISSION=0 or DN.PERMISSION=3)
+        ORDER BY DN.INSERT_TIME DESC
+      )
+  </select>
+
+
+  <!--根据Id查询公告-->
+  <select id="getNoticeById" resultType="java.util.LinkedHashMap" >
+    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"
+
+    FROM DIL_NOTICE DN
+    WHERE DN.NOTICE_ID=#{id}
+
+  </select>
+
+
+  <!--根据permission查询最新公告-->
+  <select id="getNewNoticeByPermission" resultType="java.util.LinkedHashMap" >
+    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"
+    FROM DIL_NOTICE DN
+    WHERE DN.INSERT_TIME = (SELECT MAX(DN.INSERT_TIME) FROM DIL_NOTICE DN WHERE DN.PERMISSION = #{permission} OR DN.PERMISSION =0)
+
+
+  </select>
+<!--  /*   DN.INSERT_TIME =  DN.PERMISSION =#{permission} OR DN.PERMISSION =0 AND*/-->
+  
+</mapper>