| | |
| | | package ${packageName}.service.impl; |
| | | |
| | | import cn.hutool.core.bean.BeanUtil; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | #if($table.crud || $table.sub) |
| | | import com.ruoyi.common.utils.PageUtils; |
| | | import com.ruoyi.common.core.page.PagePlus; |
| | |
| | | #set($mpMethod=$column.queryType.toLowerCase()) |
| | | #if($queryType != 'BETWEEN') |
| | | #if($javaType == 'String') |
| | | #set($condition='StrUtil.isNotBlank(bo.get'+$AttrName+'())') |
| | | #set($condition='StringUtils.isNotBlank(bo.get'+$AttrName+'())') |
| | | #else |
| | | #set($condition='bo.get'+$AttrName+'() != null') |
| | | #end |
| | |
| | | public Boolean insertByBo(${ClassName}Bo bo) { |
| | | ${ClassName} add = BeanUtil.toBean(bo, ${ClassName}.class); |
| | | validEntityBeforeSave(add); |
| | | return save(add); |
| | | boolean flag = save(add); |
| | | #set($pk=$pkColumn.javaField.substring(0,1).toUpperCase() + ${pkColumn.javaField.substring(1)}) |
| | | if (flag) { |
| | | bo.set$pk(add.get$pk()); |
| | | } |
| | | return flag; |
| | | } |
| | | |
| | | @Override |