template.Service.vm Maven / Gradle / Ivy
package ${package}.modules.${moduleName}.service;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import ${package}.modules.${moduleName}.dao.${className}Dao;
import ${package}.modules.${moduleName}.dto.${className}DTO;
import ${package}.modules.${moduleName}.entity.${className}Entity;
import com.nb6868.onex.common.jpa.DtoService;
import org.springframework.stereotype.Service;
import java.util.Map;
/**
* ${comments}
*
* @author ${author} ${email}
*/
@Service
public class ${className}Service extends DtoService<${className}Dao, ${className}Entity, ${className}DTO> {
@Override
public QueryWrapper<${className}Entity> getWrapper(String method, Map params) {
String id = (String)params.get("id");
QueryWrapper<${className}Entity> wrapper = new QueryWrapper<>();
wrapper.eq(StrUtil.isNotBlank(id), "id", id);
return wrapper;
}
}