diff --git a/pom.xml b/pom.xml index f9293f909a97dc7d95dbbddddc99e0679db65bde..ea258957e8fe635c3eea71009f97c5c246c2d7b8 100644 --- a/pom.xml +++ b/pom.xml @@ -124,6 +124,11 @@ org.springframework.boot spring-boot-starter-batch + + com.baomidou + mybatis-plus-extension + 3.5.1 + diff --git a/src/main/java/com/kwan/springbootkwan/controller/AdsDimFinancialYearWeekInfoController.java b/src/main/java/com/kwan/springbootkwan/controller/AdsDimFinancialYearWeekInfoController.java new file mode 100644 index 0000000000000000000000000000000000000000..355c8a78f2367122e0c5d3fe4ebd37c56392e7b7 --- /dev/null +++ b/src/main/java/com/kwan/springbootkwan/controller/AdsDimFinancialYearWeekInfoController.java @@ -0,0 +1,39 @@ +package com.kwan.springbootkwan.controller; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.kwan.springbootkwan.entity.AdsDimFinancialYearWeekInfo; +import com.kwan.springbootkwan.service.AdsDimFinancialYearWeekInfoService; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import javax.annotation.Resource; +import java.util.List; + +/** + * (AdsDimFinancialYearWeekInfo)表控制层 + * + * @author makejava + * @since 2022-12-22 17:25:11 + */ +@RestController +@RequestMapping("adsDimFinancialYearWeekInfo") +public class AdsDimFinancialYearWeekInfoController { + /** + * 服务对象 + */ + @Resource + private AdsDimFinancialYearWeekInfoService adsDimFinancialYearWeekInfoService; + + /** + * 通过主键查询单条数据 + */ + @GetMapping("/{financialYear}/{financialYearWeek}") + public List selectOne(@PathVariable Integer financialYear, @PathVariable Integer financialYearWeek) { + return this.adsDimFinancialYearWeekInfoService.list(new QueryWrapper() + .ne("financial_year", financialYear) + .ne("financial_year_week", financialYearWeek) + ); + } +} \ No newline at end of file diff --git a/src/main/java/com/kwan/springbootkwan/entity/AdsDimFinancialYearWeekInfo.java b/src/main/java/com/kwan/springbootkwan/entity/AdsDimFinancialYearWeekInfo.java new file mode 100644 index 0000000000000000000000000000000000000000..a7d0be22f18efdb83ac97eb85b2ba192a0f63698 --- /dev/null +++ b/src/main/java/com/kwan/springbootkwan/entity/AdsDimFinancialYearWeekInfo.java @@ -0,0 +1,90 @@ +package com.kwan.springbootkwan.entity; + + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.extension.activerecord.Model; +import io.swagger.annotations.ApiModel; +import lombok.Builder; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +@TableName(value = "ads_dim_financial_year_week_info") +@ApiModel(value = "财年周") +public class AdsDimFinancialYearWeekInfo extends Model { + //财年 + private Integer financialYear; + //第n财年周 + private Integer financialYearWeek; + //财年开始日期 + private Date financialYearStart; + //财年结束日期 + private Date financialYearEnd; + //周开始 + private Date weekStartDay; + //周结束 + private Date weekEndDay; + //财年周所在季节区间,0:跨9月1号,1:3月到8月,2:9月到2月 + private Integer weekInSeason; + + + public Integer getFinancialYear() { + return financialYear; + } + + public void setFinancialYear(Integer financialYear) { + this.financialYear = financialYear; + } + + public Integer getFinancialYearWeek() { + return financialYearWeek; + } + + public void setFinancialYearWeek(Integer financialYearWeek) { + this.financialYearWeek = financialYearWeek; + } + + public Date getFinancialYearStart() { + return financialYearStart; + } + + public void setFinancialYearStart(Date financialYearStart) { + this.financialYearStart = financialYearStart; + } + + public Date getFinancialYearEnd() { + return financialYearEnd; + } + + public void setFinancialYearEnd(Date financialYearEnd) { + this.financialYearEnd = financialYearEnd; + } + + public Date getWeekStartDay() { + return weekStartDay; + } + + public void setWeekStartDay(Date weekStartDay) { + this.weekStartDay = weekStartDay; + } + + public Date getWeekEndDay() { + return weekEndDay; + } + + public void setWeekEndDay(Date weekEndDay) { + this.weekEndDay = weekEndDay; + } + + public Integer getWeekInSeason() { + return weekInSeason; + } + + public void setWeekInSeason(Integer weekInSeason) { + this.weekInSeason = weekInSeason; + } + +} + diff --git a/src/main/java/com/kwan/springbootkwan/mapper/AdsDimFinancialYearWeekInfoMapper.java b/src/main/java/com/kwan/springbootkwan/mapper/AdsDimFinancialYearWeekInfoMapper.java new file mode 100644 index 0000000000000000000000000000000000000000..9f49252c492f82542f7402036fe2ec726efb80da --- /dev/null +++ b/src/main/java/com/kwan/springbootkwan/mapper/AdsDimFinancialYearWeekInfoMapper.java @@ -0,0 +1,19 @@ +package com.kwan.springbootkwan.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.kwan.springbootkwan.entity.AdsDimFinancialYearWeekInfo; +import org.apache.ibatis.annotations.Mapper; + + +/** + * mapper文件 + * + * @author : qinyingjie + * @version : 2.2.0 + * @date : 2022/12/19 16:12 + */ +@Mapper +public interface AdsDimFinancialYearWeekInfoMapper extends BaseMapper { + +} + diff --git a/src/main/java/com/kwan/springbootkwan/service/AdsDimFinancialYearWeekInfoService.java b/src/main/java/com/kwan/springbootkwan/service/AdsDimFinancialYearWeekInfoService.java new file mode 100644 index 0000000000000000000000000000000000000000..b0b3e77dde158b3bb982e6c62169f32eb43f9454 --- /dev/null +++ b/src/main/java/com/kwan/springbootkwan/service/AdsDimFinancialYearWeekInfoService.java @@ -0,0 +1,15 @@ +package com.kwan.springbootkwan.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.kwan.springbootkwan.entity.AdsDimFinancialYearWeekInfo; + +/** + * (AdsDimFinancialYearWeekInfo)表服务接口 + * + * @author makejava + * @since 2022-12-22 17:25:11 + */ +public interface AdsDimFinancialYearWeekInfoService extends IService { + +} + diff --git a/src/main/java/com/kwan/springbootkwan/service/impl/AdsDimFinancialYearWeekInfoServiceImpl.java b/src/main/java/com/kwan/springbootkwan/service/impl/AdsDimFinancialYearWeekInfoServiceImpl.java new file mode 100644 index 0000000000000000000000000000000000000000..3e2c638f8e5139ab8e93be367a1f4e11ad698c6e --- /dev/null +++ b/src/main/java/com/kwan/springbootkwan/service/impl/AdsDimFinancialYearWeekInfoServiceImpl.java @@ -0,0 +1,19 @@ +package com.kwan.springbootkwan.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.kwan.springbootkwan.entity.AdsDimFinancialYearWeekInfo; +import com.kwan.springbootkwan.mapper.AdsDimFinancialYearWeekInfoMapper; +import com.kwan.springbootkwan.service.AdsDimFinancialYearWeekInfoService; +import org.springframework.stereotype.Service; + +/** + * (AdsDimFinancialYearWeekInfo)表服务实现类 + * + * @author makejava + * @since 2022-12-22 17:25:11 + */ +@Service("adsDimFinancialYearWeekInfoService") +public class AdsDimFinancialYearWeekInfoServiceImpl extends ServiceImpl implements AdsDimFinancialYearWeekInfoService { + +} + diff --git a/src/main/resources/application.yaml b/src/main/resources/application.yaml index 1de9fb41ed1564582e3a5cec15342da1b8bcc57a..a8b9276aaf8799e584250bbc74a27a002bf3e4d0 100644 --- a/src/main/resources/application.yaml +++ b/src/main/resources/application.yaml @@ -49,9 +49,9 @@ spring: # mysql datasource: driver-class-name: com.mysql.cj.jdbc.Driver - url: jdbc:mysql://120.79.36.53:3306/kwan?useSSL=false&useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai + url: jdbc:mysql://localhost:3306/kwan?useSSL=false&useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai username: root - password: 15671628341Qwe. + password: 716288qwe #mybatis-plus配置 mybatis-plus: diff --git a/src/main/resources/mapper/AdsDimFinancialYearWeekInfoDao.xml b/src/main/resources/mapper/AdsDimFinancialYearWeekInfoDao.xml new file mode 100644 index 0000000000000000000000000000000000000000..ccd4001d872f6e97140d67c6cdeceb1e35bfe74c --- /dev/null +++ b/src/main/resources/mapper/AdsDimFinancialYearWeekInfoDao.xml @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + insert into kwan.ads_dim_financial_year_week_info(financial_year, financial_year_week, financial_year_start, financial_year_end, week_start_day, week_end_day, week_in_season) + values + + (#{entity.financialYear}, #{entity.financialYearWeek}, #{entity.financialYearStart}, #{entity.financialYearEnd}, #{entity.weekStartDay}, #{entity.weekEndDay}, #{entity.weekInSeason}) + + + + + insert into kwan.ads_dim_financial_year_week_info(financial_year, financial_year_week, financial_year_start, financial_year_end, week_start_day, week_end_day, week_in_season) + values + + (#{entity.financialYear}, #{entity.financialYearWeek}, #{entity.financialYearStart}, #{entity.financialYearEnd}, #{entity.weekStartDay}, #{entity.weekEndDay}, #{entity.weekInSeason}) + + on duplicate key update + financial_year = values(financial_year) , financial_year_week = values(financial_year_week) , financial_year_start = values(financial_year_start) , financial_year_end = values(financial_year_end) , week_start_day = values(week_start_day) , week_end_day = values(week_end_day) , week_in_season = values(week_in_season) + + +