| @@ -0,0 +1,37 @@ | |||||
| package com.iformall.controller.sys; | |||||
| import com.iformall.common.ResultData; | |||||
| import com.iformall.controller.base.BaseController; | |||||
| import com.iformall.domain.po.SysNotice; | |||||
| import com.iformall.service.SysNoticeService; | |||||
| import io.swagger.annotations.ApiOperation; | |||||
| import org.slf4j.Logger; | |||||
| import org.slf4j.LoggerFactory; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | |||||
| import org.springframework.web.bind.annotation.*; | |||||
| import java.util.List; | |||||
| /** | |||||
| * @author gongbiao | |||||
| */ | |||||
| @RestController | |||||
| @RequestMapping("sysnotice") | |||||
| public class SysNoticeController extends BaseController { | |||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||||
| @Autowired | |||||
| private SysNoticeService sysNoticeService; | |||||
| @ApiOperation("分页列表接口") | |||||
| @GetMapping("sysNotice") | |||||
| public ResultData sysNotice() { | |||||
| SysNotice notice = new SysNotice(); | |||||
| notice.setStatus(1); | |||||
| notice.setType(1); | |||||
| List<SysNotice> noticelist = sysNoticeService.selectList(notice); | |||||
| if (null != noticelist && noticelist.size() > 0 ) { | |||||
| return new ResultData(noticelist.get(0)); | |||||
| } | |||||
| return new ResultData(); | |||||
| } | |||||
| } | |||||
| @@ -0,0 +1,36 @@ | |||||
| package com.iformall.domain.po; | |||||
| import cn.afterturn.easypoi.excel.annotation.Excel; | |||||
| import com.baomidou.mybatisplus.annotation.TableField; | |||||
| import com.baomidou.mybatisplus.annotation.TableName; | |||||
| import com.iformall.common.SortColumn; | |||||
| import com.iformall.domain.po.base.BaseEntity; | |||||
| import com.iformall.domain.po.base.TenantEntity; | |||||
| import lombok.Data; | |||||
| import lombok.EqualsAndHashCode; | |||||
| import lombok.ToString; | |||||
| import java.math.BigDecimal; | |||||
| import java.util.Date; | |||||
| @TableName(value = "sys_notice") | |||||
| @Data | |||||
| @ToString(callSuper = true) | |||||
| @EqualsAndHashCode(callSuper = true) | |||||
| public class SysNotice extends BaseEntity { | |||||
| private Long id; | |||||
| private Integer type; | |||||
| private String content; | |||||
| private Date createTime; | |||||
| private Date updateTime; | |||||
| private Integer status; | |||||
| } | |||||
| @@ -0,0 +1,13 @@ | |||||
| package com.iformall.mapper; | |||||
| import com.iformall.common.CommonMapper; | |||||
| import com.iformall.domain.po.SysNotice; | |||||
| import java.util.List; | |||||
| /** | |||||
| * @author gongbiao | |||||
| */ | |||||
| public interface SysNoticeMapper extends CommonMapper<SysNotice, String> { | |||||
| List<SysNotice> findList(SysNotice notice); | |||||
| } | |||||
| @@ -0,0 +1,9 @@ | |||||
| package com.iformall.service; | |||||
| import java.util.*; | |||||
| import com.iformall.domain.po.SysNotice; | |||||
| public interface SysNoticeService { | |||||
| List<SysNotice> selectList(SysNotice notice) ; | |||||
| } | |||||
| @@ -0,0 +1,26 @@ | |||||
| package com.iformall.service.impl; | |||||
| import com.iformall.domain.po.SysNotice; | |||||
| import com.iformall.mapper.SysNoticeMapper; | |||||
| import com.iformall.service.SysNoticeService; | |||||
| import org.slf4j.Logger; | |||||
| import org.slf4j.LoggerFactory; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | |||||
| import org.springframework.stereotype.Service; | |||||
| import java.util.*; | |||||
| @Service | |||||
| public class SysNoticeServiceImpl implements SysNoticeService { | |||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||||
| @Autowired | |||||
| SysNoticeMapper sysNoticeMapper; | |||||
| @Override | |||||
| public List<SysNotice> selectList(SysNotice notice) { | |||||
| return sysNoticeMapper.findList(notice); | |||||
| } | |||||
| } | |||||
| @@ -0,0 +1,41 @@ | |||||
| <?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.iformall.mapper.SysNoticeMapper"> | |||||
| <resultMap id="BaseResultMap" type="com.iformall.domain.po.SysNotice"> | |||||
| <id column="id" jdbcType="BIGINT" property="id"/> | |||||
| <result column="type" jdbcType="INTEGER" property="tenantId"/> | |||||
| <result column="content" jdbcType="VARCHAR" property="parentTenantId"/> | |||||
| <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/> | |||||
| <result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/> | |||||
| <result column="status" jdbcType="INTEGER" property="status"/> | |||||
| </resultMap> | |||||
| <sql id="allColumns"> | |||||
| id,type,content,create_time,update_time,status | |||||
| </sql> | |||||
| <sql id="dynamicWhereConditions"> | |||||
| where 1=1 | |||||
| <if test=" null != id "> | |||||
| and `id` = #{id} | |||||
| </if> | |||||
| <if test=" null != type "> | |||||
| and `type` = #{type} | |||||
| </if> | |||||
| <if test=" null != status "> | |||||
| and `status` = #{status} | |||||
| </if> | |||||
| <if test=" null != sortColumns">order by ${sortColumns}</if> | |||||
| </sql> | |||||
| <select id="findList" parameterType="com.iformall.domain.po.SysNotice" resultMap="BaseResultMap"> | |||||
| select | |||||
| <include refid="allColumns"/> | |||||
| from sys_notice | |||||
| <include refid="dynamicWhereConditions"/> | |||||
| </select> | |||||
| </mapper> | |||||