This commit is contained in:
Wang.Huan
2025-03-27 15:51:44 +08:00
parent 58cdabcb55
commit 0b12bbdb91
11 changed files with 98 additions and 18 deletions

View File

@@ -9,4 +9,15 @@ import com.openhis.administration.domain.OrganizationLocation;
* @author system
* @date 2025-02-25
*/
public interface IOrganizationLocationService extends IService<OrganizationLocation> {}
public interface IOrganizationLocationService extends IService<OrganizationLocation> {
/**
* 查询机构位置关系
*
* @param orgId 机构id
* @param categoryCode 发放类型
* @return机构位置关系
*/
OrganizationLocation getOrgLocByOrgIdAndCategoryCode(Long orgId, String categoryCode);
}

View File

@@ -1,7 +1,10 @@
package com.openhis.administration.service.impl;
import java.util.Date;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.openhis.administration.domain.OrganizationLocation;
import com.openhis.administration.mapper.OrganizationLocationMapper;
@@ -17,4 +20,20 @@ import com.openhis.administration.service.IOrganizationLocationService;
public class OrganizationLocationServiceImpl extends ServiceImpl<OrganizationLocationMapper, OrganizationLocation>
implements IOrganizationLocationService {
/**
* 查询机构位置关系
*
* @param orgId 机构id
* @param categoryCode 发放类型
* @return机构位置关系
*/
@Override
public OrganizationLocation getOrgLocByOrgIdAndCategoryCode(Long orgId, String categoryCode) {
OrganizationLocation organizationLocation = baseMapper
.selectOne(new LambdaQueryWrapper<OrganizationLocation>().eq(OrganizationLocation::getOrganizationId, orgId)
.eq(OrganizationLocation::getDistributionCategoryCode, categoryCode)
.lt(OrganizationLocation::getStartTime, new Date()).gt(OrganizationLocation::getEndTime, new Date()));
return organizationLocation;
}
}