数据分离bug相关修改

This commit is contained in:
2026-03-06 15:51:30 +08:00
parent ca54b5f544
commit 73a6e881e3
15 changed files with 98 additions and 166 deletions

View File

@@ -6,7 +6,7 @@ spring:
druid:
# 主库数据源
master:
# url: jdbc:mysql://146.56.214.124:3306/zhyc?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
# url: jdbc:mysql://localhost:3306/zhyc?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
# username: zhyc
# password: zhyc1234
url: jdbc:mysql://118.182.97.76:3306/zhyc?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8

View File

@@ -50,6 +50,7 @@ public class DaSheepfoldController extends BaseController
/**
* 主表格:羊舍级别汇总列表
*/
@PreAuthorize("@ss.hasPermi('sheepfold_management:sheepfold_management:list')")
@GetMapping("/summaryList")
public TableDataInfo summaryList(DaSheepfold daSheepfold) {
startPage();

View File

@@ -8,6 +8,7 @@ import com.zhyc.common.core.page.TableDataInfo;
import com.zhyc.common.core.text.Convert;
import com.zhyc.common.enums.BusinessType;
import com.zhyc.common.utils.poi.ExcelUtil;
import com.zhyc.module.base.domain.BasSheep;
import com.zhyc.module.base.domain.SheepFile;
import com.zhyc.module.base.service.ISheepFileService;
import org.apache.commons.lang3.StringUtils;
@@ -139,7 +140,7 @@ public class SheepFileController extends BaseController
PageHelper.startPage(pageNum, pageSize);
// 调用支持复杂查询的Service方法
List<SheepFile> list = sheepFileService.selectSheepFileListByCondition(customParams, sheepFile);
List<SheepFile> list = sheepFileService.selectSheepFileListByCondition( sheepFile,customParams);
return getDataTable(list);
}
@@ -255,7 +256,7 @@ public class SheepFileController extends BaseController
}
// 3. 获取数据并执行行过滤
List<SheepFile> list = sheepFileService.selectSheepFileListByCondition(customParams, sheepFile);
List<SheepFile> list = sheepFileService.selectSheepFileListByCondition(sheepFile,customParams);
if (StringUtils.isNotBlank(exportIdsStr)) {
List<String> exportIdList = Arrays.asList(exportIdsStr.split(","));
list = list.stream()
@@ -332,28 +333,28 @@ public class SheepFileController extends BaseController
@GetMapping("/stat/sheepType")
public AjaxResult statSheepType() {
return success(sheepFileService.countBySheepType());
return success(sheepFileService.countBySheepType(new SheepFile()));
}
@GetMapping("/stat/breedStatus")
public AjaxResult statBreedStatus() {
return success(sheepFileService.countByBreedStatus());
return success(sheepFileService.countByBreedStatus(new SheepFile()));
}
@GetMapping("/stat/variety")
public AjaxResult statVariety() {
return success(sheepFileService.countByVariety());
return success(sheepFileService.countByVariety(new SheepFile()));
}
@GetMapping("/stat/lactationParity")
public AjaxResult statLactationParity() {
return success(sheepFileService.countParityOfLactation());
return success(sheepFileService.countParityOfLactation(new SheepFile()));
}
// 在群总数
@GetMapping("/stat/inGroupCount")
public AjaxResult inGroupCount() {
return success(sheepFileService.countInGroup());
return success(sheepFileService.countInGroup(new SheepFile()));
}
/**

View File

@@ -19,70 +19,6 @@ public class DaSheepfold extends BaseEntity
{
private static final long serialVersionUID = 1L;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Long getRanchId() {
return ranchId;
}
public void setRanchId(Long ranchId) {
this.ranchId = ranchId;
}
public String getSheepfoldName() {
return sheepfoldName;
}
public void setSheepfoldName(String sheepfoldName) {
this.sheepfoldName = sheepfoldName;
}
public Long getSheepfoldTypeId() {
return sheepfoldTypeId;
}
public void setSheepfoldTypeId(Long sheepfoldTypeId) {
this.sheepfoldTypeId = sheepfoldTypeId;
}
public String getSheepfoldNo() {
return sheepfoldNo;
}
public void setSheepfoldNo(String sheepfoldNo) {
this.sheepfoldNo = sheepfoldNo;
}
public String getRowNo() {
return rowNo;
}
public void setRowNo(String rowNo) {
this.rowNo = rowNo;
}
public String getColumns() {
return columns;
}
public void setColumns(String columns) {
this.columns = columns;
}
public String getComment() {
return comment;
}
public void setComment(String comment) {
this.comment = comment;
}
/** 羊舍id */
@Excel(name = "羊舍id")
private Long id;
@@ -127,20 +63,4 @@ public class DaSheepfold extends BaseEntity
/** 部门编号 */
private Long deptId;
public Long getUserId() {
return userId;
}
public void setUserId(Long userId) {
this.userId = userId;
}
public Long getDeptId() {
return deptId;
}
public void setDeptId(Long deptId) {
this.deptId = deptId;
}
}

View File

@@ -3,8 +3,6 @@ package com.zhyc.module.base.mapper;
import com.zhyc.module.base.domain.SheepFile;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.SelectProvider;
import java.util.List;
import java.util.Map;
@@ -50,19 +48,19 @@ public interface SheepFileMapper
SheepFile selectSheepByManageTags(String tags);
// 在群羊只总数
Long countInGroup();
Long countInGroup(SheepFile sheep);
// 羊只类别分布(按 name 分组)
List<Map<String,Object>> countBySheepType();
List<Map<String,Object>> countBySheepType(SheepFile sheep);
// 繁育状态分布(按 breed 分组)
List<Map<String,Object>> countByBreedStatus();
List<Map<String,Object>> countByBreedStatus(SheepFile sheep);
// 品种分布(按 variety 分组)
List<Map<String,Object>> countByVariety();
List<Map<String,Object>> countByVariety(SheepFile sheep);
// 泌乳羊胎次分布name = '泌乳羊' 时按 parity 分组)
List<Map<String,Object>> countParityOfLactation();
List<Map<String,Object>> countParityOfLactation(SheepFile sheep);
/**
* 获取指定字段的唯一值列表 (配合 XML 中的 selectFieldValues)
@@ -75,22 +73,22 @@ public interface SheepFileMapper
* 必须使用 @Param 注解以便 XML 能正确识别两个参数
*/
List<SheepFile> selectSheepFileListByCondition(
@Param("params") Map<String, Object> params,
@Param("sheepFile") SheepFile sheepFile
);
/**
* 保留原有 Provider 方法 (若项目其他地方有用到)
*/
@SelectProvider(type = SheepFileSqlProvider.class, method = "selectByCondition")
@ResultMap("SheepFileResult")
List<SheepFile> selectByCondition(
@Param("sheepFile") SheepFile sheepFile,
@Param("conditions") Map<String, Object> conditions
@Param("params") Map<String, Object> params
);
@SelectProvider(type = SheepFileSqlProvider.class, method = "selectFieldValues")
List<String> selectFieldValuesByProvider(@Param("fieldName") String fieldName);
// /**
// * 保留原有 Provider 方法 (若项目其他地方有用到)
// */
// @SelectProvider(type = SheepFileSqlProvider.class, method = "selectByCondition")
// @ResultMap("SheepFileResult")
// List<SheepFile> selectByCondition(
// @Param("sheepFile") SheepFile sheepFile,
// @Param("conditions") Map<String, Object> conditions
// );
//
// @SelectProvider(type = SheepFileSqlProvider.class, method = "selectFieldValues")
// List<String> selectFieldValuesByProvider(@Param("fieldName") String fieldName);
/**
* 查询所有公羊gender=2

View File

@@ -1,6 +1,7 @@
package com.zhyc.module.base.service;
import com.zhyc.module.base.domain.SheepFile;
import io.lettuce.core.dynamic.annotation.Param;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
@@ -34,26 +35,21 @@ public interface ISheepFileService
SheepFile selectBasSheepByManageTags(String trim);
Long countInGroup();
Long countInGroup(SheepFile sheepFile);
List<Map<String,Object>> countBySheepType();
List<Map<String,Object>> countByBreedStatus();
List<Map<String,Object>> countByVariety();
List<Map<String,Object>> countParityOfLactation();
List<Map<String,Object>> countBySheepType(SheepFile sheepFile);
List<Map<String,Object>> countByBreedStatus(SheepFile sheepFile);
List<Map<String,Object>> countByVariety(SheepFile sheepFile);
List<Map<String,Object>> countParityOfLactation(SheepFile sheepFile);
/**
* 获取指定字段的唯一值列表
*/
List<String> getFieldValues(String fieldName);
/**
* 根据复杂条件查询羊只档案列表
* @param params 自定义参数Map (用于动态SQL)
* @param sheepFile 包含List筛选条件的实体对象
*/
List<SheepFile> selectSheepFileListByCondition(
Map<String, Object> params,
SheepFile sheepFile
@Param("sheepFile") SheepFile sheepFile,
@Param("params") Map<String, Object> params
);
@Transactional

View File

@@ -63,8 +63,10 @@ public class DaSheepfoldServiceImpl implements IDaSheepfoldService
* 羊舍级别汇总查询(主表格)
*/
@DataScope(deptAlias = "ds", userAlias = "ds")
@Override
public List<DaSheepfold> selectDaSheepfoldSummaryList(DaSheepfold daSheepfold) {
return daSheepfoldMapper.selectDaSheepfoldSummaryList(daSheepfold);
List<DaSheepfold> sheepfoldList = daSheepfoldMapper.selectDaSheepfoldSummaryList(daSheepfold);
return sheepfoldList;
}
/**

View File

@@ -2,6 +2,7 @@ package com.zhyc.module.base.service.impl;
// 新增这一行导入
import com.zhyc.common.annotation.DataScope;
import com.zhyc.module.base.domain.BasSheep;
import com.zhyc.module.base.domain.BreedRamFile;
import com.zhyc.module.base.domain.SheepFile;
import com.zhyc.module.base.mapper.SheepFileMapper;
@@ -61,31 +62,33 @@ public class SheepFileServiceImpl implements ISheepFileService {
@DataScope(deptAlias = "sf", userAlias = "sf")
@Override
public List<Map<String, Object>> countBySheepType() {
return sheepFileMapper.countBySheepType();
public List<Map<String, Object>> countBySheepType(SheepFile sheepFile) {
return sheepFileMapper.countBySheepType(sheepFile);
}
@DataScope(deptAlias = "sf", userAlias = "sf")
@Override
public List<Map<String, Object>> countByBreedStatus() {
return sheepFileMapper.countByBreedStatus();
public List<Map<String, Object>> countByBreedStatus(SheepFile sheepFile) {
return sheepFileMapper.countByBreedStatus(sheepFile);
}
@DataScope(deptAlias = "sf", userAlias = "sf")
@Override
public List<Map<String, Object>> countByVariety() {
return sheepFileMapper.countByVariety();
public List<Map<String, Object>> countByVariety(SheepFile sheepFile) {
return sheepFileMapper.countByVariety(sheepFile);
}
@DataScope(deptAlias = "sf", userAlias = "sf")
@Override
public List<Map<String, Object>> countParityOfLactation() {
return sheepFileMapper.countParityOfLactation();
public List<Map<String, Object>> countParityOfLactation(SheepFile sheepFile) {
return sheepFileMapper.countParityOfLactation(sheepFile);
}
@DataScope(deptAlias = "sf", userAlias = "sf")
@Override
public Long countInGroup() { return sheepFileMapper.countInGroup(); }
public Long countInGroup(SheepFile sheepFile) {
return sheepFileMapper.countInGroup(sheepFile);
}
/**
* 获取指定字段的唯一值列表
@@ -110,13 +113,14 @@ public class SheepFileServiceImpl implements ISheepFileService {
*/
@DataScope(deptAlias = "sf", userAlias = "sf")
@Override
public List<SheepFile> selectSheepFileListByCondition(Map<String, Object> params, SheepFile sheepFile) {
public List<SheepFile> selectSheepFileListByCondition( SheepFile sheepFile,Map<String, Object> params) {
// 1. 验证并处理自定义参数 (驼峰转下划线、安全检查)
Map<String, Object> safeConditions = processConditions(params);
System.out.println("sheepFile.params: " + (sheepFile.getParams() != null ? sheepFile.getParams().get("dataScope") : "null"));
// 2. 调用 Mapper
// 这里必须使用与 XML 中 <select id="selectSheepFileListByCondition"> 对应的方法
return sheepFileMapper.selectSheepFileListByCondition(safeConditions, sheepFile);
return sheepFileMapper.selectSheepFileListByCondition(sheepFile,safeConditions);
}
@Override

View File

@@ -5,6 +5,7 @@ import java.util.Map;
import java.util.stream.Collectors;
import javax.servlet.http.HttpServletResponse;
import com.zhyc.module.base.domain.SheepFile;
import com.zhyc.module.produce.breed.domain.ScBreedPlanGenerate;
import com.zhyc.module.produce.breed.service.IScBreedPlanGenerateService;
import org.springframework.security.access.prepost.PreAuthorize;
@@ -50,7 +51,7 @@ public class ScBreedPlanGenerateController extends BaseController
@GetMapping("/selectEwe")
public AjaxResult selectEligibleEwe(@RequestParam(value = "manageTags", required = false) String manageTags)
{
List<Map<String, Object>> eligibleEwe = scBreedPlanGenerateService.selectEligibleEwe(manageTags);
List<Map<String, Object>> eligibleEwe = scBreedPlanGenerateService.selectEligibleEwe(new SheepFile(),manageTags);
return success(eligibleEwe);
}
@@ -61,7 +62,7 @@ public class ScBreedPlanGenerateController extends BaseController
@GetMapping("/selectRam")
public AjaxResult selectEligibleRam(@RequestParam(value = "manageTags", required = false) String manageTags)
{
List<Map<String, Object>> eligibleRam = scBreedPlanGenerateService.selectEligibleRam(manageTags);
List<Map<String, Object>> eligibleRam = scBreedPlanGenerateService.selectEligibleRam(new SheepFile(),manageTags);
return success(eligibleRam);
}

View File

@@ -3,6 +3,7 @@ package com.zhyc.module.produce.breed.mapper;
import java.util.List;
import java.util.Map;
import com.zhyc.module.base.domain.SheepFile;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import com.zhyc.module.produce.breed.domain.ScBreedPlanGenerate;
@@ -38,14 +39,14 @@ public interface ScBreedPlanGenerateMapper
*
* @return 符合条件的母羊列表
*/
public List<Map<String, Object>> selectEligibleEwe();
public List<Map<String, Object>> selectEligibleEwe(SheepFile sheepFile);
/**
* 筛选符合条件的公羊
*
* @return 符合条件的公羊列表
*/
public List<Map<String, Object>> selectEligibleRam();
public List<Map<String, Object>> selectEligibleRam(SheepFile sheepFile);
/**
* 新增配种计划生成

View File

@@ -3,6 +3,8 @@ package com.zhyc.module.produce.breed.service;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletResponse;
import com.zhyc.module.base.domain.SheepFile;
import com.zhyc.module.produce.breed.domain.ScBreedPlanGenerate;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.RequestParam;
@@ -37,14 +39,14 @@ public interface IScBreedPlanGenerateService
*
* @return 符合条件的母羊列表
*/
public List<Map<String, Object>> selectEligibleEwe(@RequestParam(value = "manageTags", required = false) String manageTags);
public List<Map<String, Object>> selectEligibleEwe(SheepFile sheepFile, @RequestParam(value = "manageTags", required = false) String manageTags);
/**
* 筛选符合条件的公羊
*
* @return 符合条件的公羊列表
*/
public List<Map<String, Object>> selectEligibleRam(@RequestParam(value = "manageTags", required = false) String manageTags);
public List<Map<String, Object>> selectEligibleRam(SheepFile sheepFile, @RequestParam(value = "manageTags", required = false) String manageTags);
void exportSelectedPairs(HttpServletResponse response, List<Long> eweIds, List<Long> ramIds);

View File

@@ -11,6 +11,7 @@ import java.io.InputStream;
import javax.servlet.http.HttpServletResponse;
import com.zhyc.common.annotation.DataScope;
import com.zhyc.module.base.domain.SheepFile;
import com.zhyc.module.produce.breed.domain.ScBreedPlan;
import com.zhyc.module.produce.breed.domain.ScBreedPlanGenerate;
import com.zhyc.module.produce.breed.mapper.ScBreedPlanGenerateMapper;
@@ -65,19 +66,21 @@ public class ScBreedPlanGenerateServiceImpl implements IScBreedPlanGenerateServi
/**
* 筛选符合条件的母羊
*/
@DataScope(deptAlias = "bs", userAlias = "bs")
@Override
public List<Map<String, Object>> selectEligibleEwe(@RequestParam(value = "manageTags", required = false) String manageTags)
public List<Map<String, Object>> selectEligibleEwe(SheepFile sheepFile, @RequestParam(value = "manageTags", required = false) String manageTags)
{
return scBreedPlanGenerateMapper.selectEligibleEwe();
return scBreedPlanGenerateMapper.selectEligibleEwe(sheepFile);
}
/**
* 筛选符合条件的公羊
*/
@DataScope(deptAlias = "bs", userAlias = "bs")
@Override
public List<Map<String, Object>> selectEligibleRam(@RequestParam(value = "manageTags", required = false) String manageTags)
public List<Map<String, Object>> selectEligibleRam(SheepFile sheepFile,@RequestParam(value = "manageTags", required = false) String manageTags)
{
return scBreedPlanGenerateMapper.selectEligibleRam();
return scBreedPlanGenerateMapper.selectEligibleRam(sheepFile);
}
/**
@@ -453,7 +456,7 @@ public class ScBreedPlanGenerateServiceImpl implements IScBreedPlanGenerateServi
result.put("planInfo", planGenerate);
List<Map<String, Object>> planDetails = scBreedPlanGenerateMapper.selectApproveBreedPlanDetails(id);
result.put("planDetails", planDetails);
List<Map<String, Object>> availableRams = scBreedPlanGenerateMapper.selectEligibleRam();
List<Map<String, Object>> availableRams = scBreedPlanGenerateMapper.selectEligibleRam(new SheepFile());
result.put("availableRams", availableRams);
return result;
}

View File

@@ -46,6 +46,7 @@ public class ScPregnancyRecordServiceImpl implements IScPregnancyRecordService
* @param scPregnancyRecord 孕检记录
* @return 孕检记录
*/
@DataScope(deptAlias = "pr", userAlias = "pr")
@Override
public List<ScPregnancyRecord> selectScPregnancyRecordList(ScPregnancyRecord scPregnancyRecord)
{

View File

@@ -74,7 +74,7 @@
</resultMap>
<sql id="selectSheepFileVo">
select id, bs_manage_tags, ranch_id, dr_ranch, sheepfold_id, sheepfold_name, electronic_tags, variety_id, variety, family, name, gender, birthday, day_age, month_age, parity, birth_weight, weaning_date, status_id, weaning_weight, current_weight,weaning_day_age,weaning_daily_gain,breed_status_id, breed, bs_father_id, father_manage_tags, bs_mother_id, mother_manage_tags, receptor_id, receptor_manage_tags, father_father_id, grandfather_manage_tags, father_mother_id, grandmother_manage_tags, father_id, maternal_grandfather_manage_tags, mother_id, maternal_grandmother_manage_tags, mating_date, mating_type_id, preg_date, lambing_date, lambing_day, mating_day, gestation_day, expected_date, post_lambing_day, lactation_day, anestrous_day, mating_counts, mating_total, miscarriage_counts, comment, controlled, body, breast, source, source_date, source_ranch_id, source_ranch, update_by, update_time, create_by, create_time, is_delete from sheep_file
select id, bs_manage_tags, ranch_id, dr_ranch, sheepfold_id, sheepfold_name, electronic_tags, variety_id, variety, family, name, gender, birthday, day_age, month_age, parity, birth_weight, weaning_date, status_id, weaning_weight, current_weight,weaning_day_age,weaning_daily_gain,breed_status_id, breed, bs_father_id, father_manage_tags, bs_mother_id, mother_manage_tags, receptor_id, receptor_manage_tags, father_father_id, grandfather_manage_tags, father_mother_id, grandmother_manage_tags, father_id, maternal_grandfather_manage_tags, mother_id, maternal_grandmother_manage_tags, mating_date, mating_type_id, preg_date, lambing_date, lambing_day, mating_day, gestation_day, expected_date, post_lambing_day, lactation_day, anestrous_day, mating_counts, mating_total, miscarriage_counts, comment, controlled, body, breast, source, source_date, source_ranch_id, source_ranch, update_by, update_time, create_by, create_time, is_delete from sheep_file sf
</sql>
<select id="selectSheepFileList" parameterType="SheepFile" resultMap="SheepFileResult">
@@ -95,7 +95,7 @@
ORDER BY id ASC
</select>
<select id="searchEarNumbers" resultType="String">
<select id="searchEarNumbers" resultType="java.lang.String">
SELECT DISTINCT bs_manage_tags
FROM sheep_file
WHERE (is_delete = 0 OR is_delete IS NULL)
@@ -116,53 +116,53 @@
where bs_manage_tags = #{tags}
</select>
<select id="countInGroup" resultType="java.lang.Long">
<select id="countInGroup" resultType="java.lang.Long" parameterType="SheepFile">
SELECT COUNT(*)
FROM sheep_file sf
WHERE sf.status_id = 1
AND (sf.is_delete = 0 OR sf.is_delete IS NULL)
${params.dataScope}
${params.dataScope}
</select>
<select id="countBySheepType" resultType="java.util.Map">
<select id="countBySheepType" resultType="java.util.Map" parameterType="SheepFile">
SELECT sf.name AS name, COUNT(*) AS value
FROM sheep_file sf
WHERE sf.status_id = 1
AND (sf.is_delete = 0 OR sf.is_delete IS NULL)
${params.dataScope}
${params.dataScope}
GROUP BY sf.name
</select>
<select id="countByBreedStatus" resultType="java.util.Map">
<select id="countByBreedStatus" resultType="java.util.Map" parameterType="SheepFile">
SELECT sf.breed AS name, COUNT(*) AS value
FROM sheep_file sf
WHERE sf.status_id = 1
AND (sf.is_delete = 0 OR sf.is_delete IS NULL)
${params.dataScope}
${params.dataScope}
GROUP BY sf.breed
</select>
<select id="countByVariety" resultType="java.util.Map">
<select id="countByVariety" resultType="java.util.Map" parameterType="SheepFile">
SELECT sf.variety AS name, COUNT(*) AS value
FROM sheep_file sf
WHERE sf.status_id = 1
AND (sf.is_delete = 0 OR sf.is_delete IS NULL)
${params.dataScope}
${params.dataScope}
GROUP BY sf.variety
</select>
<select id="countParityOfLactation" resultType="java.util.Map">
<select id="countParityOfLactation" resultType="java.util.Map" parameterType="SheepFile">
SELECT sf.parity AS name, COUNT(*) AS value
FROM sheep_file sf
WHERE sf.status_id = 1
AND sf.name = '泌乳羊'
AND (sf.is_delete = 0 OR sf.is_delete IS NULL)
${params.dataScope}
${params.dataScope}
GROUP BY sf.parity
ORDER BY sf.parity
</select>
<select id="selectFieldValues" parameterType="String" resultType="String">
<select id="selectFieldValues" parameterType="String" resultType="java.lang.String">
SELECT DISTINCT ${fieldName} as field_value
FROM sheep_file
WHERE ${fieldName} IS NOT NULL AND ${fieldName} != '' AND ${fieldName} != 'null'
@@ -173,7 +173,7 @@
<include refid="selectSheepFileVo"/>
<where>
AND (is_delete = 0 OR is_delete IS NULL)
${sheepFile.params.dataScope}
<if test="sheepFile != null">
<if test="sheepFile.allEarNumbers != null and sheepFile.allEarNumbers.size() > 0">
AND bs_manage_tags IN
@@ -282,7 +282,7 @@
</if>
</foreach>
</if>
${params.dataScope}
</where>
ORDER BY id ASC
</select>

View File

@@ -61,7 +61,7 @@
</select>
<!-- 筛选符合条件的母羊关联bas_sheep不需要数据权限 -->
<select id="selectEligibleEwe" resultType="Map">
<select id="selectEligibleEwe" resultType="java.util.Map" >
select
bs.id,
bs.manage_tags as bs_manage_tags,
@@ -86,9 +86,10 @@
left join da_sheepfold dsf on bs.sheepfold_id = dsf.id
where bs.gender = 1
and bs.is_delete = 0
<if test="manageTags != null and manageTags != ''">
and bs.manage_tags like concat('%', #{manageTags}, '%')
<if test="bsManageTags != null and bsManageTags != ''">
and bs.manage_tags like concat('%', #{bsManageTags}, '%')
</if>
${params.dataScope}
and (bs.status_id = 1 or bs.status_id is null)
and (
(bst.name in ('青年羊', '超龄羊') and (
@@ -103,7 +104,7 @@
</select>
<!-- 筛选符合条件的公羊关联bas_sheep不需要数据权限 -->
<select id="selectEligibleRam" resultType="Map">
<select id="selectEligibleRam" resultType="java.util.Map">
select
bs.id,
bs.manage_tags as bs_manage_tags,
@@ -121,9 +122,10 @@
left join bas_breed_status bbs on bs.breed_status_id = bbs.id
where bs.gender = 2
and bs.is_delete = 0
<if test="manageTags != null and manageTags != ''">
and bs.manage_tags like concat('%', #{manageTags}, '%')
<if test="bsManageTags != null and bsManageTags != ''">
and bs.manage_tags like concat('%', #{bsManageTags}, '%')
</if>
${params.dataScope}
and bs.status_id = 1
and (
(bst.name in ('青年羊', '超龄羊') and (
@@ -212,7 +214,7 @@
</insert>
<!-- 获取配种计划详情:关联查询,不需要数据权限 -->
<select id="selectBreedPlanDetails" parameterType="Long" resultType="Map">
<select id="selectBreedPlanDetails" parameterType="Long" resultType="java.util.Map">
select
temp.id,
temp.ram_id,
@@ -254,7 +256,7 @@
</select>
<!-- 获取审批详情:关联查询,不需要数据权限 -->
<select id="selectApproveBreedPlanDetails" parameterType="Long" resultType="Map">
<select id="selectApproveBreedPlanDetails" parameterType="Long" resultType="java.util.Map">
select
temp.id,
temp.ram_id,