Merge remote-tracking branch 'origin/master'
						commit
						13c74fafba
					
				| @ -0,0 +1,7 @@ | ||||
| package com.glxp.api.dao.system; | ||||
| 
 | ||||
| import com.baomidou.mybatisplus.core.mapper.BaseMapper; | ||||
| import com.glxp.api.entity.system.SyncDataChangeBustypesEntity; | ||||
| 
 | ||||
| public interface SyncDataChangeBustypesDao extends BaseMapper<SyncDataChangeBustypesEntity> { | ||||
| } | ||||
| @ -0,0 +1,31 @@ | ||||
| package com.glxp.api.entity.system; | ||||
| 
 | ||||
| import com.baomidou.mybatisplus.annotation.IdType; | ||||
| import com.baomidou.mybatisplus.annotation.TableField; | ||||
| import com.baomidou.mybatisplus.annotation.TableId; | ||||
| import com.baomidou.mybatisplus.annotation.TableName; | ||||
| import lombok.Data; | ||||
| 
 | ||||
| /** | ||||
|  * 单据同步 - 业务单据类型 | ||||
|  */ | ||||
| @Data | ||||
| @TableName(value = "sync_data_change_bustypes") | ||||
| public class SyncDataChangeBustypesEntity { | ||||
| 
 | ||||
|     @TableId(value = "id", type = IdType.AUTO) | ||||
|     private Integer id; | ||||
| 
 | ||||
|     @TableField(value = "`action`") | ||||
|     private String action; | ||||
| 
 | ||||
|     @TableField(value = "`name`") | ||||
|     private String name; | ||||
| 
 | ||||
|     @TableField(value = "outChange") | ||||
|     private boolean outChange; | ||||
| 
 | ||||
|     @TableField(value = "orderStatus") | ||||
|     private Integer orderStatus; | ||||
| 
 | ||||
| } | ||||
| @ -0,0 +1,18 @@ | ||||
| package com.glxp.api.service.sync; | ||||
| 
 | ||||
| import com.glxp.api.entity.system.SyncDataChangeBustypesEntity; | ||||
| 
 | ||||
| import java.util.List; | ||||
| 
 | ||||
| /** | ||||
|  * 单据同步 - 业务单据类型 Service | ||||
|  */ | ||||
| public interface SyncDataChangeBustypeService { | ||||
| 
 | ||||
|     List<SyncDataChangeBustypesEntity> findAll(); | ||||
| 
 | ||||
|     boolean deleteAll(); | ||||
| 
 | ||||
|     void inserts(List<SyncDataChangeBustypesEntity> syncDataChangeBustypesEntities); | ||||
| 
 | ||||
| } | ||||
| @ -0,0 +1,44 @@ | ||||
| package com.glxp.api.service.sync.impl; | ||||
| 
 | ||||
| import cn.hutool.core.collection.CollUtil; | ||||
| import com.glxp.api.dao.system.SyncDataChangeBustypesDao; | ||||
| import com.glxp.api.entity.system.SyncDataChangeBustypesEntity; | ||||
| import com.glxp.api.service.sync.SyncDataChangeBustypeService; | ||||
| import org.apache.ibatis.session.ExecutorType; | ||||
| import org.apache.ibatis.session.SqlSession; | ||||
| import org.apache.ibatis.session.SqlSessionFactory; | ||||
| import org.apache.ibatis.session.TransactionIsolationLevel; | ||||
| import org.springframework.stereotype.Service; | ||||
| import org.springframework.transaction.annotation.Transactional; | ||||
| 
 | ||||
| import javax.annotation.Resource; | ||||
| import java.util.List; | ||||
| 
 | ||||
| @Service | ||||
| @Transactional(rollbackFor = Exception.class) | ||||
| public class SyncDataChangeBustypeServiceImpl implements SyncDataChangeBustypeService { | ||||
| 
 | ||||
|     @Resource | ||||
|     private SyncDataChangeBustypesDao syncDataChangeBustypesDao; | ||||
|     @Resource | ||||
|     private SqlSessionFactory sqlSessionFactory; | ||||
| 
 | ||||
|     @Override | ||||
|     public List<SyncDataChangeBustypesEntity> findAll() { | ||||
|         return syncDataChangeBustypesDao.selectList(null); | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public boolean deleteAll() { | ||||
|         syncDataChangeBustypesDao.delete(null); | ||||
|         return true; | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public void inserts(List<SyncDataChangeBustypesEntity> syncDataChangeBustypesEntities) { | ||||
|         if (CollUtil.isNotEmpty(syncDataChangeBustypesEntities)) { | ||||
|             SqlSession sqlSession = sqlSessionFactory.openSession(ExecutorType.BATCH, TransactionIsolationLevel.READ_COMMITTED); | ||||
|             syncDataChangeBustypesEntities.forEach(item -> syncDataChangeBustypesDao.insert(item)); | ||||
|         } | ||||
|     } | ||||
| } | ||||
| @ -0,0 +1,17 @@ | ||||
| <?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.glxp.api.dao.system.SyncDataChangeBustypesDao"> | ||||
|   <resultMap id="BaseResultMap" type="com.glxp.api.entity.system.SyncDataChangeBustypesEntity"> | ||||
|     <!--@mbg.generated--> | ||||
|     <!--@Table sync_data_change_bustypes--> | ||||
|     <id column="id" jdbcType="INTEGER" property="id" /> | ||||
|     <result column="action" jdbcType="VARCHAR" property="action" /> | ||||
|     <result column="name" jdbcType="VARCHAR" property="name" /> | ||||
|     <result column="outChange" jdbcType="TINYINT" property="outChange" /> | ||||
|     <result column="orderStatus" jdbcType="TINYINT" property="orderStatus" /> | ||||
|   </resultMap> | ||||
|   <sql id="Base_Column_List"> | ||||
|     <!--@mbg.generated--> | ||||
|     id, `action`, `name`, outChange, orderStatus | ||||
|   </sql> | ||||
| </mapper> | ||||
					Loading…
					
					
				
		Reference in New Issue