Blame view

src/main/resources/templates/vm/java/Service.java.vm 2 KB
mahuandong authored
1
package ${packageName}.service;
tangying authored
2
3
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
mahuandong authored
4
import ${packageName}.domain.${ClassName};
5
6
7
import ${packageName}.mapper.${ClassName}Mapper;
import org.springframework.stereotype.Service;
tangying authored
8
9

/**
10
 * ${functionName} 服务层实现
tangying authored
11
12
13
14
 * 
 * @author ${author}
 * @date ${datetime}
 */
15
16
@Service
public class ${className}Service extends ServiceImpl<${ClassName}Mapper, ${ClassName}>  {
tangying authored
17
18

}
19
20
21
##	@Autowired
##	private ${className}mapper ${classname}mapper;
##
tangying authored
22
23
24
25
26
27
##	/**
##     * 查询${tableComment}信息
##     *
##     * @param ${primaryKey.attrname} ${tableComment}ID
##     * @return ${tableComment}信息
##     */
28
29
30
31
32
##    @Override
##	public ${className} select${className}ById(${primaryKey.attrType} ${primaryKey.attrname})
##	{
##	    return ${classname}mapper.select${className}ById(${primaryKey.attrname});
##	}
tangying authored
33
34
35
36
37
38
39
##
##	/**
##     * 查询${tableComment}列表
##     *
##     * @param ${classname} ${tableComment}信息
##     * @return ${tableComment}集合
##     */
40
41
42
43
44
##	@Override
##	public List<${className}> select${className}List(${className} ${classname})
##	{
##	    return ${classname}mapper.select${className}List(${classname});
##	}
tangying authored
45
##
46
##    /**
tangying authored
47
48
49
50
51
##     * 新增${tableComment}
##     *
##     * @param ${classname} ${tableComment}信息
##     * @return 结果
##     */
52
53
54
55
56
##	@Override
##	public int insert${className}(${className} ${classname})
##	{
##	    return ${classname}mapper.insert${className}(${classname});
##	}
tangying authored
57
58
59
60
61
62
63
##
##	/**
##     * 修改${tableComment}
##     *
##     * @param ${classname} ${tableComment}信息
##     * @return 结果
##     */
64
65
66
67
68
##	@Override
##	public int update${className}(${className} ${classname})
##	{
##	    return ${classname}mapper.update${className}(${classname});
##	}
tangying authored
69
70
##
##	/**
71
##     * 删除${tableComment}对象
tangying authored
72
73
74
75
##     *
##     * @param ids 需要删除的数据ID
##     * @return 结果
##     */
76
77
78
79
80
##	@Override
##	public int delete${className}ByIds(String ids)
##	{
##		return ${classname}mapper.delete${className}ByIds(Convert.toStrArray(ids));
##	}