Browse Source

增删改查接口,去掉mybatis

yuzijian 2 năm trước cách đây
mục cha
commit
1aa55e3dc3

+ 0 - 21
pom.xml

@@ -94,27 +94,6 @@
             <groupId>org.springframework.boot</groupId>
             <artifactId>spring-boot-starter-thymeleaf</artifactId>
         </dependency>
-        <!--mybatis plus extension,包含了mybatis plus core-->
-        <dependency>
-            <groupId>com.baomidou</groupId>
-            <artifactId>mybatis-plus-extension</artifactId>
-            <version>3.3.1</version>
-        </dependency>
-        <dependency>
-            <groupId>com.baomidou</groupId>
-            <artifactId>mybatis-plus-annotation</artifactId>
-            <version>3.3.1</version>
-        </dependency>
-        <dependency>
-            <groupId>com.baomidou</groupId>
-            <artifactId>mybatis-plus-boot-starter</artifactId>
-            <version>3.3.1</version>
-        </dependency>
-        <dependency>
-            <groupId>org.mybatis.spring.boot</groupId>
-            <artifactId>mybatis-spring-boot-starter</artifactId>
-            <version>2.1.1</version>
-        </dependency>
         <dependency>
             <groupId>org.hibernate</groupId>
             <artifactId>hibernate-core</artifactId>

+ 2 - 9
src/main/java/com/syjy/calculate/config/StarterAutoConfigure.java

@@ -3,8 +3,7 @@ package com.syjy.calculate.config;
 import com.syjy.calculate.conotroller.JarCalculate;
 import com.syjy.calculate.conotroller.Test;
 import com.syjy.calculate.listener.ApplicationListenerImpl;
-import com.syjy.calculate.mapper.CalculationFormulaMapper;
-import com.syjy.calculate.mapper.CalculationFormulaServiceImpl;
+
 import com.syjy.calculate.repository.repositoryImpl.CalculationFormulaRepositoryImpl;
 import com.syjy.calculate.service.AccuracyPassRateCalculateService;
 import com.syjy.calculate.util.CreateAndInsertSqlUtil;
@@ -17,7 +16,7 @@ import org.springframework.context.annotation.Configuration;
 
 @EnableConfigurationProperties(StarterProperties.class)
 @Configuration
-@ComponentScan(basePackages = {"com.syjy.calculate.mapper"})
+
 
 
 public class StarterAutoConfigure {
@@ -71,12 +70,6 @@ public class StarterAutoConfigure {
     CalculationFormulaMapper calculationFormulaMapper() {
         return new CalculationFormulaMapper();
     }*/
-@Bean
-@ConditionalOnMissingBean
-@ConditionalOnProperty(prefix = "calculate.service", value = "enabled", havingValue = "true")
-CalculationFormulaServiceImpl clculationFormulaServiceImpl() {
-    return new CalculationFormulaServiceImpl();
-}
 
 
 

+ 1 - 3
src/main/java/com/syjy/calculate/entity/tCalculationFormula.java

@@ -1,7 +1,6 @@
 package com.syjy.calculate.entity;
 
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.annotation.TableId;
+
 import com.fasterxml.jackson.annotation.JsonFormat;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
@@ -29,7 +28,6 @@ public class tCalculationFormula implements Serializable  {
      */
     private static final long serialVersionUID = 1L;
 
-    @TableId(value = "id", type = IdType.AUTO)
     private Integer id;
 
     /**

+ 0 - 10
src/main/java/com/syjy/calculate/mapper/CalculationFormulaMapper.java

@@ -1,10 +0,0 @@
-package com.syjy.calculate.mapper;
-
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-
-import com.syjy.calculate.entity.tCalculationFormula;
-import org.apache.ibatis.annotations.Mapper;
-
-@Mapper
-public interface CalculationFormulaMapper  extends BaseMapper<tCalculationFormula> {
-}

+ 0 - 35
src/main/java/com/syjy/calculate/mapper/CalculationFormulaService.java

@@ -1,35 +0,0 @@
-package com.syjy.calculate.mapper;
-
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.baomidou.mybatisplus.extension.service.IService;
-import com.syjy.calculate.entity.tCalculationFormula;
-import org.apache.ibatis.annotations.*;
-import org.springframework.context.annotation.ComponentScan;
-import org.springframework.stereotype.Repository;
-import org.springframework.stereotype.Service;
-
-import java.util.List;
-
-/*@Repository
-public interface CalculationFormulaMapper{
-    @Select("SELECT * from t_calculation_formula")
-    List<CalculationFormula> findAll();
-
-    @Select("INSERT INTO t_calculation_formula(type,`order`,formula,province_enum,state) VALUES(#{type},#{order},#{formula},#{province},#{state})")
-    void add(String type, Integer order, String formula, String province, String state);
-
-    @Update("UPDATE t_calculation_formula\n" +
-            "SET type = #{type}\n," +
-            " `order` = #{order}\n," +
-            " `formula` = #{formula}\n," +
-            " `province_enum` = #{province}\n," +
-            " `state` = #{state}\n" +
-            "WHERE id = #{id};\n")
-    void edit(Integer id, String type, Integer order, String formula, String province, String state);
-
-    @Delete("DELETE FROM t_calculation_formula WHERE id = #{id}")
-    void delete(Integer id);
-}*/
-public interface CalculationFormulaService extends IService<tCalculationFormula> {
-
-}

+ 0 - 12
src/main/java/com/syjy/calculate/mapper/CalculationFormulaServiceImpl.java

@@ -1,12 +0,0 @@
-package com.syjy.calculate.mapper;
-
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-
-import com.baomidou.mybatisplus.extension.service.IService;
-import com.syjy.calculate.entity.tCalculationFormula;
-import org.springframework.stereotype.Service;
-
-@Service
-public class CalculationFormulaServiceImpl extends ServiceImpl <CalculationFormulaMapper, tCalculationFormula> implements CalculationFormulaService {
-
-}

+ 0 - 1
src/main/java/com/syjy/calculate/repository/CalculationFormulaRepository.java

@@ -1,7 +1,6 @@
 package com.syjy.calculate.repository;
 
 import com.syjy.calculate.entity.tCalculationFormula;
-import org.apache.ibatis.annotations.Select;
 import org.springframework.stereotype.Repository;
 
 import java.util.List;