Merge remote-tracking branch 'origin/main'

This commit is contained in:
2026-01-13 21:46:09 +08:00
28 changed files with 243 additions and 115 deletions

View File

@@ -59,13 +59,29 @@ public class SheepFileController extends BaseController
} catch (NumberFormatException e) {
// 使用默认值
}
} else if (queryParams.containsKey("page") && queryParams.get("page") != null) {
// 如果 pageNum 不存在,则尝试使用 page
try {
pageNum = Integer.parseInt(queryParams.get("page").toString());
} catch (NumberFormatException e) {
// 使用默认值
}
}
if (queryParams.containsKey("pageSize") && queryParams.get("pageSize") != null) {
try {
pageSize = Integer.parseInt(queryParams.get("pageSize").toString());
} catch (NumberFormatException e) {
// 使用默认值
}
}else if (queryParams.containsKey("limit") && queryParams.get("limit") != null) {
// 如果 pageSize 不存在,则尝试使用 limit
try {
pageSize = Integer.parseInt(queryParams.get("limit").toString());
} catch (NumberFormatException e) {
// 使用默认值
}
}
// 提取常规查询参数到 SheepFile 对象

View File

@@ -33,7 +33,7 @@ public class SheepFileSqlProvider {
// 添加动态条件
addDynamicConditions(sql, conditions);
sql.ORDER_BY("id DESC");
sql.ORDER_BY("id ASC");
return sql.toString();
}

View File

@@ -90,7 +90,7 @@ public class DdFe extends BaseEntity
@Excel(name = "废弃原因")
private String discardTxt;
public void setId(Long id)
public void setId(Long id)
{
this.id = id;
}

View File

@@ -4,14 +4,7 @@ import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import com.zhyc.common.annotation.Log;
import com.zhyc.common.core.controller.BaseController;
import com.zhyc.common.core.domain.AjaxResult;
@@ -101,4 +94,9 @@ public class ScChangeCommentController extends BaseController
{
return toAjax(scChangeCommentService.deleteScChangeCommentByIds(ids));
}
@GetMapping("/search_ear_numbers")
public AjaxResult searchEarNumbers(@RequestParam("query") String query){
return success(scChangeCommentService.searchEarNumbers(query.trim()));
}
}

View File

@@ -7,14 +7,7 @@ import com.zhyc.module.base.domain.BasSheep;
import com.zhyc.module.base.service.IBasSheepService;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import com.zhyc.common.annotation.Log;
import com.zhyc.common.core.controller.BaseController;
import com.zhyc.common.core.domain.AjaxResult;
@@ -23,6 +16,7 @@ import com.zhyc.module.produce.manage_sheep.domain.ScChangeEar;
import com.zhyc.module.produce.manage_sheep.service.IScChangeEarService;
import com.zhyc.common.utils.poi.ExcelUtil;
import com.zhyc.common.core.page.TableDataInfo;
import org.springframework.web.bind.annotation.RequestParam;
/**
* 修改电子耳号记录Controller
@@ -116,4 +110,9 @@ public class ScChangeEarController extends BaseController
{
return toAjax(scChangeEarService.deleteScChangeEarByIds(ids));
}
@GetMapping("/search_ear_numbers")
public AjaxResult searchEarNumbers(@RequestParam("query") String query){
return success(scChangeEarService.searchEarNumbers(query.trim()));
}
}

View File

@@ -4,14 +4,7 @@ import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import com.zhyc.common.annotation.Log;
import com.zhyc.common.core.controller.BaseController;
import com.zhyc.common.core.domain.AjaxResult;
@@ -101,4 +94,9 @@ public class ScChangeVarietyController extends BaseController
{
return toAjax(scChangeVarietyService.deleteScChangeVarietyByIds(ids));
}
@GetMapping("/search_ear_numbers")
public AjaxResult searchEarNumbers(@RequestParam("query") String query){
return success(scChangeVarietyService.searchEarNumbers(query.trim()));
}
}

View File

@@ -5,14 +5,7 @@ import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import com.zhyc.common.annotation.Log;
import com.zhyc.common.core.controller.BaseController;
import com.zhyc.common.core.domain.AjaxResult;
@@ -116,4 +109,9 @@ public class ScTransitionInfoController extends BaseController {
int rows = scTransitionInfoService.approveScTransitionInfo(scTransitionInfo);
return toAjax(rows);
}
@GetMapping("/search_ear_numbers")
public AjaxResult searchEarNumbers(@RequestParam("query") String query){
return success(scTransitionInfoService.searchEarNumbers(query.trim()));
}
}

View File

@@ -8,6 +8,7 @@ import com.zhyc.common.annotation.Excel;
import com.zhyc.common.core.domain.BaseEntity;
import java.util.Date;
import java.util.List;
/**
* 改备注对象 sc_change_comment
@@ -67,4 +68,7 @@ public class ScChangeComment extends BaseEntity {
*/
@Excel(name = "技术员")
private String technician;
/** 前端多耳号条件,非数据库字段 */
private List<String> manageTagsList;
}

View File

@@ -8,6 +8,7 @@ import com.zhyc.common.annotation.Excel;
import com.zhyc.common.core.domain.BaseEntity;
import java.util.Date;
import java.util.List;
/**
* 修改电子耳号记录对象 sc_change_ear
@@ -84,4 +85,7 @@ public class ScChangeEar extends BaseEntity {
@Excel(name = "技术员")
private String technician;
/** 前端多耳号查询条件,非表字段 */
private List<String> manageTagsList;
}

View File

@@ -1,6 +1,7 @@
package com.zhyc.module.produce.manage_sheep.domain;
import java.util.Date;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
@@ -77,4 +78,6 @@ public class ScChangeVariety extends BaseEntity {
@JsonFormat(pattern = "yyyy-MM-dd")
private Date eventDate;
/** 前端多耳号查询条件,非表字段 */
private List<String> manageTagsList;
}

View File

@@ -7,6 +7,7 @@ import com.zhyc.common.annotation.Excel;
import com.zhyc.common.core.domain.BaseEntity;
import java.time.LocalDate;
import java.util.List;
/**
* 转场对象 sc_transition_info
@@ -96,5 +97,6 @@ public class ScTransitionInfo extends BaseEntity {
@Excel(name = "备注")
private String comment;
/** 前端多耳号查询条件,非表字段 */
private List<String> manageTagsList;
}

View File

@@ -2,6 +2,7 @@ package com.zhyc.module.produce.manage_sheep.mapper;
import java.util.List;
import com.zhyc.module.produce.manage_sheep.domain.ScChangeComment;
import org.apache.ibatis.annotations.Param;
/**
* 改备注Mapper接口
@@ -58,4 +59,13 @@ public interface ScChangeCommentMapper
* @return 结果
*/
public int deleteScChangeCommentByIds(Long[] ids);
List<ScChangeComment> selectScChangeCommentList(
@Param("sc") ScChangeComment sc,
@Param("manageTagsList") List<String> manageTagsList);
/**
* 远程下拉:模糊搜索耳号
*/
List<String> searchEarNumbers(@Param("query") String query);
}

View File

@@ -2,6 +2,7 @@ package com.zhyc.module.produce.manage_sheep.mapper;
import java.util.List;
import com.zhyc.module.produce.manage_sheep.domain.ScChangeEar;
import org.apache.ibatis.annotations.Param;
/**
* 修改电子耳号记录Mapper接口
@@ -58,4 +59,14 @@ public interface ScChangeEarMapper
* @return 结果
*/
public int deleteScChangeEarByIds(Integer[] ids);
/**
* 远程下拉:模糊搜索耳号
*/
List<String> searchEarNumbers(@Param("query") String query);
/* 列表查询支持多耳号模糊 */
List<ScChangeEar> selectScChangeEarList(
@Param("sc") ScChangeEar sc,
@Param("manageTagsList") List<String> manageTagsList);
}

View File

@@ -2,6 +2,7 @@ package com.zhyc.module.produce.manage_sheep.mapper;
import java.util.List;
import com.zhyc.module.produce.manage_sheep.domain.ScChangeVariety;
import org.apache.ibatis.annotations.Param;
/**
* 改品种记录Mapper接口
@@ -58,4 +59,14 @@ public interface ScChangeVarietyMapper
* @return 结果
*/
public int deleteScChangeVarietyByIds(Integer[] ids);
/**
* 远程下拉:模糊搜索耳号
*/
List<String> searchEarNumbers(@Param("query") String query);
/* 列表查询支持多耳号模糊 */
List<ScChangeVariety> selectScChangeVarietyList(
@Param("sc") ScChangeVariety sc,
@Param("manageTagsList") List<String> manageTagsList);
}

View File

@@ -64,4 +64,13 @@ public interface ScTransitionInfoMapper
//批量转场
int insertScTransitionInfoBatch(@Param("list") List<ScTransitionInfo> transitionInfoList);
/**
* 远程下拉:模糊搜索耳号
*/
List<String> searchEarNumbers(@Param("query") String query);
/* 列表查询支持多耳号模糊 */
List<ScTransitionInfo> selectScTransitionInfoList(
@Param("sc") ScTransitionInfo sc,
@Param("manageTagsList") List<String> manageTagsList);
}

View File

@@ -58,4 +58,9 @@ public interface IScChangeCommentService
* @return 结果
*/
public int deleteScChangeCommentById(Long id);
/**
* 远程模糊搜索耳号(下拉用)
*/
List<String> searchEarNumbers(String query);
}

View File

@@ -58,4 +58,6 @@ public interface IScChangeEarService
* @return 结果
*/
public int deleteScChangeEarById(Integer id);
List<String> searchEarNumbers(String query);
}

View File

@@ -58,4 +58,6 @@ public interface IScChangeVarietyService
* @return 结果
*/
public int deleteScChangeVarietyById(Integer id);
List<String> searchEarNumbers(String query);
}

View File

@@ -71,4 +71,5 @@ public interface IScTransitionInfoService {
//审批转场
public int approveScTransitionInfo(ScTransitionInfo scTransitionInfo);
List<String> searchEarNumbers(String query);
}

View File

@@ -49,9 +49,14 @@ public class ScChangeCommentServiceImpl implements IScChangeCommentService
@Override
public List<ScChangeComment> selectScChangeCommentList(ScChangeComment scChangeComment)
{
return scChangeCommentMapper.selectScChangeCommentList(scChangeComment);
// 把实体和独立参数一起传过去
return scChangeCommentMapper.selectScChangeCommentList(scChangeComment,
scChangeComment.getManageTagsList());
}
@Override
public List<String> searchEarNumbers(String query) {
return scChangeCommentMapper.searchEarNumbers(query);
}
/**
* 新增改备注
*

View File

@@ -67,8 +67,8 @@ public class ScChangeEarServiceImpl implements IScChangeEarService
*/
@Override
public List<ScChangeEar> selectScChangeEarList(ScChangeEar scChangeEar) {
List<ScChangeEar> list = scChangeEarMapper.selectScChangeEarList(scChangeEar);
return list;
return scChangeEarMapper.selectScChangeEarList(scChangeEar,
scChangeEar.getManageTagsList());
}
/**
@@ -166,4 +166,10 @@ public class ScChangeEarServiceImpl implements IScChangeEarService
{
return scChangeEarMapper.deleteScChangeEarById(id);
}
@Override
public List<String> searchEarNumbers(String query) {
return scChangeEarMapper.searchEarNumbers(query.trim());
}
}

View File

@@ -52,7 +52,8 @@ public class ScChangeVarietyServiceImpl implements IScChangeVarietyService
@Override
public List<ScChangeVariety> selectScChangeVarietyList(ScChangeVariety scChangeVariety)
{
return scChangeVarietyMapper.selectScChangeVarietyList(scChangeVariety);
return scChangeVarietyMapper.selectScChangeVarietyList(scChangeVariety,
scChangeVariety.getManageTagsList());
}
/**
@@ -133,4 +134,9 @@ public class ScChangeVarietyServiceImpl implements IScChangeVarietyService
{
return scChangeVarietyMapper.deleteScChangeVarietyById(id);
}
@Override
public List<String> searchEarNumbers(String query) {
return scChangeVarietyMapper.searchEarNumbers(query.trim());
}
}

View File

@@ -55,7 +55,8 @@ public class ScTransitionInfoServiceImpl implements IScTransitionInfoService
@Override
public List<ScTransitionInfo> selectScTransitionInfoList(ScTransitionInfo scTransitionInfo)
{
return scTransitionInfoMapper.selectScTransitionInfoList(scTransitionInfo);
return scTransitionInfoMapper.selectScTransitionInfoList(scTransitionInfo,
scTransitionInfo.getManageTagsList());
}
/**
@@ -212,4 +213,9 @@ public class ScTransitionInfoServiceImpl implements IScTransitionInfoService
transTypeMap.put(2, "育肥调拨");
return transTypeMap.getOrDefault(transTypeCode, "未知类型");
}
@Override
public List<String> searchEarNumbers(String query) {
return scTransitionInfoMapper.searchEarNumbers(query.trim());
}
}

View File

@@ -90,6 +90,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="statusId != null "> and status_id = #{statusId}</if>
<if test="breed != null and breed != ''"> and breed = #{breed}</if>
</where>
ORDER BY id ASC <!-- 修改为升序 -->
</select>
<select id="selectSheepFileById" parameterType="Long" resultMap="SheepFileResult">
@@ -260,7 +261,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</foreach>
</if>
</where>
ORDER BY id DESC
ORDER BY id ASC
</select>
<!-- &lt;!&ndash; 查询所有公羊gender=2 &ndash;&gt;-->

View File

@@ -35,26 +35,31 @@
left join da_sheepfold sf on bs.sheepfold_id = sf.id
</sql>
<select id="selectScChangeCommentList" parameterType="ScChangeComment" resultMap="ScChangeCommentResult">
<select id="selectScChangeCommentList" resultMap="ScChangeCommentResult">
<include refid="selectScChangeCommentVo"/>
<where>
<if test="manageTags != null and manageTags != ''">
and bs.manage_tags like concat('%', #{manageTags}, '%')
<!-- 多耳号 + 每只模糊 -->
<if test="manageTagsList != null and manageTagsList.size() > 0">
<foreach collection="manageTagsList" item="tag" separator="or" open="and (" close=")">
bs.manage_tags like concat('%', #{tag}, '%')
</foreach>
</if>
<if test="sheepfoldId != null">and bs.sheepfold_id = #{sheepfoldId}</if>
<if test="newComment != null and newComment != ''">
and scc.new_comment like concat('%', #{newComment}, '%')
<if test="sc.sheepfoldId != null">
and bs.sheepfold_id = #{sc.sheepfoldId}
</if>
<if test="oldComment != null and oldComment != ''">
and scc.old_comment like concat('%', #{oldComment}, '%')
<if test="sc.newComment != null and sc.newComment != ''">
and scc.new_comment like concat('%', #{sc.newComment}, '%')
</if>
<if test="params.beginCreateTime != null and params.beginCreateTime != ''
and params.endCreateTime != null and params.endCreateTime != ''">
and scc.create_time between #{params.beginCreateTime} and #{params.endCreateTime}
<if test="sc.oldComment != null and sc.oldComment != ''">
and scc.old_comment like concat('%', #{sc.oldComment}, '%')
</if>
<if test="params.beginEventDate != null and params.beginEventDate != ''
and params.endEventDate != null and params.endEventDate != ''">
and scc.event_date between #{params.beginEventDate} and #{params.endEventDate}
<if test="sc.params != null and sc.params.beginCreateTime != null and sc.params.beginCreateTime != ''
and sc.params.endCreateTime != null and sc.params.endCreateTime != ''">
and scc.create_time between #{sc.params.beginCreateTime} and #{sc.params.endCreateTime}
</if>
<if test="sc.params != null and sc.params.beginEventDate != null and sc.params.beginEventDate != ''
and sc.params.endEventDate != null and sc.params.endEventDate != ''">
and scc.event_date between #{sc.params.beginEventDate} and #{sc.params.endEventDate}
</if>
</where>
ORDER BY scc.create_time DESC
@@ -111,4 +116,13 @@
#{id}
</foreach>
</delete>
<select id="searchEarNumbers" resultType="java.lang.String">
SELECT DISTINCT bs.manage_tags
FROM bas_sheep bs
WHERE bs.manage_tags LIKE CONCAT('%', #{query}, '%')
AND bs.is_delete = 0
ORDER BY bs.manage_tags
LIMIT 50
</select>
</mapper>

View File

@@ -43,34 +43,27 @@
LEFT JOIN da_sheepfold sf ON bs.sheepfold_id = sf.id
</sql>
<select id="selectScChangeEarList" parameterType="ScChangeEar" resultMap="ScChangeEarResult">
<select id="selectScChangeEarList" resultMap="ScChangeEarResult">
<include refid="selectScChangeEarVo"/>
<where>
<if test="sheepId != null">and sce.sheep_id = #{sheepId}</if>
<if test="manageTags != null and manageTags != ''">
and (
bs.manage_tags LIKE CONCAT('%', #{manageTags}, '%')
OR
bs.electronic_tags LIKE CONCAT('%', #{manageTags}, '%')
)
<if test="sc.sheepId != null">and sce.sheep_id = #{sc.sheepId}</if>
<if test="manageTagsList != null and manageTagsList.size() > 0">
<foreach collection="manageTagsList" item="tag" separator="or" open="and (" close=")">
(bs.manage_tags like concat('%', #{tag}, '%')
or bs.electronic_tags like concat('%', #{tag}, '%'))
</foreach>
</if>
<if test="sheepfoldId != null">and bs.sheepfold_id = #{sheepfoldId}</if>
<if test="sheepfoldName != null and sheepfoldName != ''">
and sf.sheepfold_name LIKE CONCAT('%', #{sheepfoldName}, '%')
<if test="sc.sheepfoldId != null">and bs.sheepfold_id = #{sc.sheepfoldId}</if>
<if test="sc.earType != null">and sce.ear_type = #{sc.earType}</if>
<if test="sc.newTag != null and sc.newTag != ''">and sce.newTag like concat('%', #{sc.newTag}, '%')</if>
<if test="sc.oldTag != null and sc.oldTag != ''">and sce.oldTag like concat('%', #{sc.oldTag}, '%')</if>
<if test="sc.params != null and sc.params.beginCreateTime != null and sc.params.beginCreateTime != ''
and sc.params.endCreateTime != null and sc.params.endCreateTime != ''">
and sce.create_time between #{sc.params.beginCreateTime} and #{sc.params.endCreateTime}
</if>
<if test="earType != null ">and sce.ear_type = #{earType}</if>
<if test="newTag != null and newTag != ''">
and sce.newTag LIKE CONCAT('%', #{newTag}, '%')
</if>
<if test="oldTag != null and oldTag != ''">
and sce.oldTag LIKE CONCAT('%', #{oldTag}, '%')
</if>
<if test="params.beginCreateTime != null and params.beginCreateTime != '' and params.endCreateTime != null and params.endCreateTime != ''">
and sce.create_time between #{params.beginCreateTime} and #{params.endCreateTime}
</if>
<if test="params.beginEventDate != null and params.beginEventDate != ''
and params.endEventDate != null and params.endEventDate != ''">
and sce.event_date between #{params.beginEventDate} and #{params.endEventDate}
<if test="sc.params != null and sc.params.beginEventDate != null and sc.params.beginEventDate != ''
and sc.params.endEventDate != null and sc.params.endEventDate != ''">
and sce.event_date between #{sc.params.beginEventDate} and #{sc.params.endEventDate}
</if>
</where>
ORDER BY sce.create_time DESC
@@ -133,4 +126,13 @@
#{id}
</foreach>
</delete>
<select id="searchEarNumbers" resultType="java.lang.String">
SELECT DISTINCT bs.manage_tags
FROM bas_sheep bs
WHERE bs.manage_tags LIKE CONCAT('%', #{query}, '%')
AND bs.is_delete = 0
ORDER BY bs.manage_tags
LIMIT 50
</select>
</mapper>

View File

@@ -37,27 +37,26 @@
left join da_sheepfold sf on bs.sheepfold_id = sf.id
</sql>
<select id="selectScChangeVarietyList" parameterType="ScChangeVariety" resultMap="ScChangeVarietyResult">
<select id="selectScChangeVarietyList" resultMap="ScChangeVarietyResult">
<include refid="selectScChangeVarietyVo"/>
<where>
<if test="sheepId != null">and scv.sheep_id = #{sheepId}</if>
<if test="manageTags != null and manageTags != ''">
and bs.manage_tags like concat('%', #{manageTags}, '%')
<!-- 多耳号 + 每只模糊 -->
<if test="manageTagsList != null and manageTagsList.size() > 0">
<foreach collection="manageTagsList" item="tag" separator="or" open="and (" close=")">
bs.manage_tags like concat('%', #{tag}, '%')
</foreach>
</if>
<if test="sheepfoldId != null">and bs.sheepfold_id = #{sheepfoldId}</if>
<if test="varietyOld != null and varietyOld != ''">
and scv.variety_old like concat('%', #{varietyOld}, '%')
<!-- 其余统一加 sc. 前缀 -->
<if test="sc.sheepId != null">and scv.sheep_id = #{sc.sheepId}</if>
<if test="sc.sheepfoldId != null">and bs.sheepfold_id = #{sc.sheepfoldId}</if>
<if test="sc.varietyOld != null and sc.varietyOld != ''">and scv.variety_old like concat('%', #{sc.varietyOld}, '%')</if>
<if test="sc.varietyNew != null and sc.varietyNew != ''">and scv.variety_new like concat('%', #{sc.varietyNew}, '%')</if>
<if test="sc.params != null and sc.params.beginCreateTime != null and sc.params.beginCreateTime != '' and sc.params.endCreateTime != null and sc.params.endCreateTime != ''">
and scv.create_time between #{sc.params.beginCreateTime} and #{sc.params.endCreateTime}
</if>
<if test="varietyNew != null and varietyNew != ''">
and scv.variety_new like concat('%', #{varietyNew}, '%')
</if>
<if test="params.beginCreateTime != null and params.beginCreateTime != ''
and params.endCreateTime != null and params.endCreateTime != ''">
and scv.create_time between #{params.beginCreateTime} and #{params.endCreateTime}
</if>
<if test="params.beginEventDate != null and params.beginEventDate != ''
and params.endEventDate != null and params.endEventDate != ''">
and scv.event_date between #{params.beginEventDate} and #{params.endEventDate}
<if test="sc.params != null and sc.params.beginEventDate != null and sc.params.beginEventDate != '' and sc.params.endEventDate != null and sc.params.endEventDate != ''">
and scv.event_date between #{sc.params.beginEventDate} and #{sc.params.endEventDate}
</if>
</where>
ORDER BY scv.create_time DESC
@@ -117,4 +116,13 @@
#{id}
</foreach>
</delete>
<select id="searchEarNumbers" resultType="java.lang.String">
SELECT DISTINCT bs.manage_tags
FROM bas_sheep bs
WHERE bs.manage_tags LIKE CONCAT('%', #{query}, '%')
AND bs.is_delete = 0
ORDER BY bs.manage_tags
LIMIT 50
</select>
</mapper>

View File

@@ -44,28 +44,26 @@
LEFT JOIN bas_sheep_variety bv ON bs.variety_id = bv.id
</sql>
<select id="selectScTransitionInfoList" parameterType="ScTransitionInfo" resultMap="ScTransitionInfoResult">
<select id="selectScTransitionInfoList" resultMap="ScTransitionInfoResult">
<include refid="selectScTransitionInfoVo"/>
<where>
<if test="sheepId != null ">and sheep_id = #{sheepId}</if>
<if test="manageTags != null and manageTags != ''">
and bs.manage_tags LIKE CONCAT('%', #{manageTags}, '%')
<!-- 多耳号 + 每只模糊 -->
<if test="manageTagsList != null and manageTagsList.size() > 0">
<foreach collection="manageTagsList" item="tag" separator="or" open="and (" close=")">
bs.manage_tags like concat('%', #{tag}, '%')
</foreach>
</if>
<!-- <if test="eventType != null and eventType != ''">-->
<!-- and t.event_type = #{eventType}-->
<!-- </if>-->
<if test="transType != null">and t.trans_type = #{transType}</if>
<if test="params.beginTransitionDate != null and params.beginTransitionDate != ''
and params.endTransitionDate != null and params.endTransitionDate != ''">
and t.transition_date between #{params.beginTransitionDate} and #{params.endTransitionDate}
<!-- 其余统一加 sc. 前缀 -->
<if test="sc.sheepId != null">and t.sheep_id = #{sc.sheepId}</if>
<if test="sc.transType != null">and t.trans_type = #{sc.transType}</if>
<if test="sc.varietyId != null">and bs.variety_id = #{sc.varietyId}</if>
<if test="sc.transTo != null and sc.transTo != ''">and t.trans_to = #{sc.transTo}</if>
<if test="sc.transFrom != null and sc.transFrom != ''">and t.trans_from = #{sc.transFrom}</if>
<if test="sc.status != null">and t.status = #{sc.status}</if>
<if test="sc.params != null and sc.params.beginTransitionDate != null and sc.params.beginTransitionDate != '' and sc.params.endTransitionDate != null and sc.params.endTransitionDate != ''">
and t.transition_date between #{sc.params.beginTransitionDate} and #{sc.params.endTransitionDate}
</if>
<if test="varietyId != null">and bs.variety_id = #{varietyId}</if>
<if test="transTo != null and transTo != ''">and trans_to = #{transTo}</if>
<if test="transFrom != null and transFrom != ''">and trans_from = #{transFrom}</if>
<if test="status != null ">and status = #{status}</if>
<!-- <if test="params.beginCreateTime != null and params.beginCreateTime != '' and params.endCreateTime != null and params.endCreateTime != ''">-->
<!-- and t.create_time between #{params.beginCreateTime} and #{params.endCreateTime}-->
<!-- </if>-->
</where>
ORDER BY t.create_time DESC
</select>
@@ -154,4 +152,13 @@
#{id}
</foreach>
</delete>
<select id="searchEarNumbers" resultType="java.lang.String">
SELECT DISTINCT bs.manage_tags
FROM bas_sheep bs
WHERE bs.manage_tags LIKE CONCAT('%', #{query}, '%')
AND bs.is_delete = 0
ORDER BY bs.manage_tags
LIMIT 50
</select>
</mapper>