自定义Iservice和ServiceImpl
							parent
							
								
									508caa86e0
								
							
						
					
					
						commit
						fa79cbf280
					
				| @ -0,0 +1,12 @@ | ||||
| package com.glxp.api.service; | ||||
| 
 | ||||
| import com.baomidou.mybatisplus.extension.service.IService; | ||||
| 
 | ||||
| import java.util.List; | ||||
| 
 | ||||
| public interface CustomService<T> extends IService<T> { | ||||
|     int insertIgnore(T entity); | ||||
|     int insertIgnoreBatch(List<T> entityList); | ||||
|     int replace(T entity); | ||||
|     int replaceBatch(List<T> entityList); | ||||
| } | ||||
| @ -0,0 +1,29 @@ | ||||
| package com.glxp.api.service; | ||||
| 
 | ||||
| import com.baomidou.mybatisplus.core.mapper.BaseMapper; | ||||
| import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | ||||
| import com.glxp.api.dao.BaseMapperPlus; | ||||
| 
 | ||||
| import java.util.List; | ||||
| 
 | ||||
| public class CustomServiceImpl<M extends BaseMapper<T>, T> extends ServiceImpl<BaseMapperPlus<M,T,T>, T>  implements CustomService<T>{ | ||||
|     @Override | ||||
|     public int insertIgnore(T entity) { | ||||
|         return baseMapper.insertIgnore(entity); | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public int insertIgnoreBatch(List<T> entityList) { | ||||
|         return baseMapper.insertIgnoreBatch(entityList); | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public int replace(T entity) { | ||||
|         return baseMapper.replace(entity); | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public int replaceBatch(List<T> entityList) { | ||||
|         return baseMapper.replaceBatch(entityList); | ||||
|     } | ||||
| } | ||||
					Loading…
					
					
				
		Reference in New Issue