| | |
| | | import com.ruoyi.common.core.page.TableDataInfo; |
| | | import com.ruoyi.common.core.domain.PageQuery; |
| | | #end |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.stereotype.Service; |
| | | import com.ruoyi.common.core.mybatisplus.core.ServicePlusImpl; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import ${packageName}.domain.bo.${ClassName}Bo; |
| | |
| | | * @author ${author} |
| | | * @date ${datetime} |
| | | */ |
| | | @RequiredArgsConstructor |
| | | @Service |
| | | public class ${ClassName}ServiceImpl extends ServicePlusImpl<${ClassName}Mapper, ${ClassName}, ${ClassName}Vo> implements I${ClassName}Service { |
| | | public class ${ClassName}ServiceImpl implements I${ClassName}Service { |
| | | |
| | | private final ${ClassName}Mapper baseMapper; |
| | | |
| | | @Override |
| | | public ${ClassName}Vo queryById(${pkColumn.javaType} ${pkColumn.javaField}){ |
| | |
| | | public Boolean insertByBo(${ClassName}Bo bo) { |
| | | ${ClassName} add = BeanUtil.toBean(bo, ${ClassName}.class); |
| | | validEntityBeforeSave(add); |
| | | int rows = baseMapper.insert(add); |
| | | boolean flag = baseMapper.insert(add); |
| | | #set($pk=$pkColumn.javaField.substring(0,1).toUpperCase() + ${pkColumn.javaField.substring(1)}) |
| | | if (rows > 0) { |
| | | if (flag) { |
| | | bo.set$pk(add.get$pk()); |
| | | } |
| | | return rows > 0; |
| | | return flag; |
| | | } |
| | | |
| | | @Override |
| | | public Boolean updateByBo(${ClassName}Bo bo) { |
| | | ${ClassName} update = BeanUtil.toBean(bo, ${ClassName}.class); |
| | | validEntityBeforeSave(update); |
| | | return baseMapper.updateById(update) > 0; |
| | | return baseMapper.updateById(update); |
| | | } |
| | | |
| | | /** |