<%
var entityName = toCamelCase(isBlank(prefix) ? table.name : subAfter(table.name, prefix));
var controllerClass = upperFirst(entityName) + "Controller";
var entityClass = upperFirst(entityName) + "Entity";
var entityInstance = entityName + "Entity";
var serviceClass = upperFirst(entityName) + "Service";
var serviceInstance = entityName + "Service";
var mapperClass = upperFirst(entityName) + "Mapper";
var baseUrl = isBlank(prefix) ? table.name : subAfter(table.name, prefix);
%>
package ${basePackage}.${moduleName}.service;

import lombok.extern.slf4j.Slf4j;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.njzscloud.common.mp.support.PageParam;
import com.njzscloud.common.mp.support.PageResult;
import java.util.List;
import ${basePackage}.${moduleName}.pojo.entity.${entityClass};
import ${basePackage}.${moduleName}.mapper.${mapperClass};

/**
 * ${table.comment}
 */
@Slf4j
@Service
@RequiredArgsConstructor
public class ${serviceClass} extends ServiceImpl<${mapperClass}, ${entityClass}> implements IService<${entityClass}> {

    /**
     * 新增
     */
    public void add(${entityClass} ${entityInstance}) {
        this.save(${entityInstance});
    }

    /**
     * 修改
     */
    public void modify(${entityClass} ${entityInstance}) {
        this.updateById(${entityInstance});
    }

    /**
     * 删除
     */
    @Transactional(rollbackFor = Exception.class)
    public void del(List<Long> ids) {
        this.removeBatchByIds(ids);
    }

    /**
     * 详情
     */
    public ${entityClass} detail(Long id) {
        return this.getById(id);
    }

    /**
     * 分页查询
     */
    public PageResult<${entityClass}> paging(PageParam pageParam, ${entityClass} ${entityInstance}) {
        return PageResult.of(this.page(pageParam.toPage(), Wrappers.<${entityClass}>query(${entityInstance})));
    }
}
