Java Spring @Resource 注解使用示例 - 内部日数据查询服务
@Resource private InternaldayMapper internaldayMapper;
@Override
public List
@Override public Internalday findByDateId(String dateId) { return internaldayMapper.selectByDateId(dateId); }
// This piece of code is a class that implements a service interface. It has two methods:
// 1. 'findByConditions': This method takes an 'Internalday' object as a parameter and returns a list of 'Internalday' objects. It uses the 'internaldayMapper' to select the 'Internalday' objects based on the conditions specified in the 'internaldayParam'.
// 2. 'findByDateId': This method takes a 'dateId' as a parameter and returns an 'Internalday' object. It uses the 'internaldayMapper' to select the 'Internalday' object based on the 'dateId'.
// The '@Resource' annotation is used to inject the 'internaldayMapper' bean into the class.
原文地址: https://www.cveoy.top/t/topic/o2gk 著作权归作者所有。请勿转载和采集!