Commit b80c7b07 authored by qinxunjia's avatar qinxunjia

dao修改

parent ca00cbcf
package com.jz;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
@MapperScan(" com.jz.sms.repository.mapper")
public class Application {
public static void main(String[] args) {
......
package com.jz.sms.config;
import com.baomidou.mybatisplus.plugins.PaginationInterceptor;
import com.baomidou.mybatisplus.plugins.PerformanceInterceptor;
import org.mybatis.spring.mapper.MapperScannerConfigurer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration
//@MapperScan("com.baomidou.springboot.mapper*")//这个注解,作用相当于下面的@Bean MapperScannerConfigurer,2者配置1份即可
public class MybatisPlusConfig {
/**
* SQL输出拦截器,性能分析器,不建议生产环境使用,开发环境使用(方便)
*/
@Bean
public PerformanceInterceptor performanceInterceptor() {
PerformanceInterceptor performanceInterceptor = new PerformanceInterceptor();
//sql格式化
performanceInterceptor.setFormat(true);
return performanceInterceptor;
}
/**
* mybatis-plus分页插件<br>
* 文档:http://mp.baomidou.com<br>
*/
@Bean
public PaginationInterceptor paginationInterceptor() {
PaginationInterceptor paginationInterceptor = new PaginationInterceptor();
//paginationInterceptor.setDialectType("mysql"); //指定数据库类型,不写自动匹配
return paginationInterceptor;
};
@Bean
public MapperScannerConfigurer mapperScannerConfigurer() {
MapperScannerConfigurer scannerConfigurer = new MapperScannerConfigurer();
scannerConfigurer.setBasePackage("com.baomidou.springboot.mapper*");
return scannerConfigurer;
}
}
\ No newline at end of file
package com.jz.sms.repository;
package com.jz.sms.repository.mapper;
import org.springframework.stereotype.Repository;
/**
* Mybatis 接口文件
*/
@Repository
public interface MessageMapper {
// int createTemplate(XXXX....)
......
package com.jz.sms.repository;
package com.jz.sms.repository.mapper;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.jz.sms.repository.domain.SmsTemplateInfo;
......@@ -6,7 +6,6 @@ import com.jz.sms.repository.domain.SysBatchInfo;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;
@Repository
public interface SysBatchMapper extends BaseMapper<SysBatchInfo> {
......
package com.jz.sms.repository;
package com.jz.sms.repository.mapper;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.jz.sms.repository.domain.SmsTemplateInfo;
......@@ -6,7 +6,6 @@ import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;
@Repository
public interface TemplateMapper extends BaseMapper<SmsTemplateInfo> {
......
......@@ -3,12 +3,9 @@ package com.jz.sms.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.jz.sms.chuanlan.service.ChuanLanSmsService;
import com.jz.sms.dto.*;
import com.jz.sms.repository.SysBatchMapper;
import com.jz.sms.repository.TemplateMapper;
import com.jz.sms.repository.domain.SmsTemplateInfo;
import com.jz.sms.repository.domain.SysBatchInfo;
import com.jz.sms.repository.mapper.SysBatchMapper;
import com.jz.sms.repository.mapper.TemplateMapper;
import com.jz.sms.service.MessageService;
import com.jz.sms.util.id.IdHandler;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -16,11 +13,11 @@ import org.springframework.stereotype.Service;
public class MessageServiceImpl implements MessageService {
// @Autowired
// private SysBatchMapper sysBatchMapper;
@Autowired
private SysBatchMapper sysBatchMapper;
//
// @Autowired
// private TemplateMapper templateMapper;
@Autowired
private TemplateMapper templateMapper;
@Autowired
private ChuanLanSmsService chuanLanSmsService;
......
<?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.jz.sms.repository.MessageMapper">
<mapper namespace="com.jz.sms.repository.mapper.MessageMapper">
</mapper>
\ No newline at end of file
<?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.jz.sms.repository.SysBatchMapper">
<mapper namespace="com.jz.sms.repository.mapper.SysBatchMapper">
......
<?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.jz.sms.repository.TemplateMapper">
<mapper namespace="com.jz.sms.repository.mapper.TemplateMapper">
<resultMap id="baseMap" type="com.jz.sms.repository.domain.SmsTemplateInfo">
......
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