Merge remote-tracking branch 'origin/main'

This commit is contained in:
zyh
2026-03-01 14:13:43 +08:00
20 changed files with 196 additions and 41 deletions

View File

@@ -6,9 +6,9 @@ spring:
druid:
# 主库数据源
master:
# url: jdbc:mysql://localhost:3306/zhyc?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
# username: root
# password: 123456
# url: jdbc:mysql://146.56.214.124: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
username: zhyc
password: yszh123

View File

@@ -26,6 +26,7 @@ public class Deworm extends BaseEntity
/** $column.columnComment */
private Long id;
private Long[] ids;
private Long sheepId;

View File

@@ -26,9 +26,10 @@ public class Diagnosis extends BaseEntity
/** $column.columnComment */
private Long id;
private Long[] ids;
/** 治疗记录id */
@Excel(name = "治疗记录")
// @Excel(name = "治疗记录")
private Long treatId;
private Integer[] treatIds;
/** 时间日期 */

View File

@@ -25,6 +25,7 @@ public class Disinfect extends BaseEntity
/** id */
private Long id;
private Long[] ids;
/** 羊舍id */
@Excel(name = "羊舍")
@@ -43,12 +44,12 @@ public class Disinfect extends BaseEntity
@Excel(name = "技术员")
private String technician;
/** 消毒方式 */
@Excel(name = "消毒方式")
/** 消毒方式0喷雾 1撒布 2浸泡 3熏蒸 4其他 */
@Excel(name = "消毒方式", readConverterExp = "0=喷雾,1=撒布,2=浸泡,3=熏蒸,4=其他")
private String way;
/** 药品使用记录id */
@Excel(name = "药品使用记录id")
// @Excel(name = "药品使用记录id")
private Integer usageId;
/** 比例 */

View File

@@ -22,6 +22,7 @@ public class Health extends BaseEntity
/** $column.columnComment */
private Long id;
private Long[] ids;
/** 保健日期 */
@JsonFormat(pattern = "yyyy-MM-dd")
@@ -57,7 +58,7 @@ public class Health extends BaseEntity
private Long parity;
/** 用药记录 */
@Excel(name = "用药记录")
// @Excel(name = "用药记录")
private Integer usageId;

View File

@@ -26,6 +26,7 @@ public class Immunity extends BaseEntity
/** $column.columnComment */
private Long id;
private Long[] ids;
/** 羊只id */
private Long sheepId;
@@ -59,7 +60,7 @@ public class Immunity extends BaseEntity
private Long parity;
/** 使用记录 */
@Excel(name = "使用记录")
// @Excel(name = "使用记录")
private Integer usageId;

View File

@@ -28,6 +28,7 @@ public class SwMedicineUsage extends BaseEntity
/** id */
private Integer id;
private Long[] ids;
/** 使用名称 */
@Excel(name = "使用名称",width = 20, needMerge = true)

View File

@@ -26,6 +26,7 @@ public class Treatment extends BaseEntity
private static final long serialVersionUID = 1L;
private Long id;
private Long[] ids;
/** 诊疗记录id */
private Long diagId;

View File

@@ -0,0 +1,74 @@
package com.zhyc.module.biosafety.enums;
/**
* 消毒方式枚举
*/
public enum DisinfectionMethod {
SPRAY(0, "喷雾"),
SCATTER(1, "撒布"),
SOAK(2, "浸泡"),
FUMIGATE(3, "熏蒸"),
OTHER(4, "其他");
private final int code;
private final String desc;
DisinfectionMethod(int code, String desc) {
this.code = code;
this.desc = desc;
}
public int getCode() {
return code;
}
public String getDesc() {
return desc;
}
/**
* 根据code获取描述
*/
public static String getDescByCode(Integer code) {
if (code == null) {
return "";
}
for (DisinfectionMethod method : values()) {
if (method.code == code) {
return method.desc;
}
}
return "";
}
/**
* 根据code获取枚举
*/
public static DisinfectionMethod getByCode(Integer code) {
if (code == null) {
return null;
}
for (DisinfectionMethod method : values()) {
if (method.code == code) {
return method;
}
}
return null;
}
/**
* 根据描述获取code
*/
public static Integer getCodeByDesc(String desc) {
if (desc == null || desc.trim().isEmpty()) {
return null;
}
for (DisinfectionMethod method : values()) {
if (method.desc.equals(desc)) {
return method.code;
}
}
return null;
}
}

View File

@@ -27,7 +27,9 @@ public class UserPostController {
@GetMapping("/getUser")
public AjaxResult getUserPost(String postCode){
User user = new User();
user.setPostCode(postCode);
if (postCode != null){
user.setPostName(postCode);
}
List<User> list = userService.getUserListByCode(user);
return AjaxResult.success(list);
}

View File

@@ -34,6 +34,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectDewormList" parameterType="Deworm" resultMap="DewormResult">
<include refid="selectDewormVo"/>
<where>
<!-- 根据ids数组查询 -->
<if test="ids != null and ids.length > 0">
AND s.id IN
<foreach collection="ids" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</if>
<if test="sheepId != null">and sheep_id = #{sheepId}</if>
<if test="sheepNo != null and sheepNo != ''">and bs.manage_tags like concat('%',#{sheepNo},'%')</if>
<if test="sheepNos != null and sheepNos.length > 0">

View File

@@ -42,7 +42,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectDiagnosisList" parameterType="Diagnosis" resultMap="DiagnosisResult">
<include refid="selectDiagnosisVo"/>
<where>
<where>
<!-- 根据ids数组查询 -->
<if test="ids != null and ids.length > 0">
AND sd.id IN
<foreach collection="ids" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</if>
<if test="sheepId != null "> and sd.sheep_id = #{sheepId}</if>
<if test="sheepNo != null"> and sf.bs_manage_tags like concat('%', #{sheepNo}, '%')</if>
<if test="sheepNos != null and sheepNos.length > 0">

View File

@@ -41,30 +41,36 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
sd.create_by,
sd.create_time,
ds.sheepfold_name
FROM sw_disinfect sd
FROM sw_disinfect sd
LEFT JOIN da_sheepfold ds ON ds.id = sd.sheepfold_id
<where>1 = 1
<if test="sheepfoldId != null"> AND sd.sheepfold_id = #{sheepfoldId}</if>
<if test="datetime != null"> AND sd.datetime = #{datetime}</if>
<if test="technician != null and technician != ''"> AND sd.technician = #{technician}</if>
<if test="way != null and way != ''"> AND sd.way = #{way}</if>
<if test="usageId != null"> AND sd.usage_id = #{usageId}</if>
<if test="ratio != null and ratio != ''"> AND sd.ratio = #{ratio}</if>
<if test="comment != null and comment != ''"> AND sd.comment = #{comment}</if>
<!-- 子表过滤条件:仅保留满足药品名称的记录 -->
<if test="mediName != null and mediName != ''">
AND EXISTS (
SELECT 1
FROM sw_medicine_usage_details mud
JOIN sw_medicine sm ON sm.id = mud.medi_id
WHERE mud.medi_usage = sd.usage_id
AND sm.name like concat('%',#{mediName},'%')
)
</if>
${params.dataScope}
<!-- 根据ids数组查询 -->
<if test="ids != null and ids.length > 0">
AND sd.id IN
<foreach collection="ids" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</if>
<if test="sheepfoldId != null"> AND sd.sheepfold_id = #{sheepfoldId}</if>
<if test="datetime != null"> AND sd.datetime = #{datetime}</if>
<if test="technician != null and technician != ''"> AND sd.technician = #{technician}</if>
<if test="way != null and way != ''"> AND sd.way = #{way}</if>
<if test="usageId != null"> AND sd.usage_id = #{usageId}</if>
<if test="ratio != null and ratio != ''"> AND sd.ratio = #{ratio}</if>
<if test="comment != null and comment != ''"> AND sd.comment = #{comment}</if>
<!-- 子表过滤条件:仅保留满足药品名称的记录 -->
<if test="mediName != null and mediName != ''">
AND EXISTS (
SELECT 1
FROM sw_medicine_usage_details mud
JOIN sw_medicine sm ON sm.id = mud.medi_id
WHERE mud.medi_usage = sd.usage_id
AND sm.name like concat('%',#{mediName},'%')
)
</if>
${params.dataScope}
</where>
ORDER BY datetime DESC
ORDER BY datetime DESC
</select>
<select id="selectDisinfectById" parameterType="Long" resultMap="DisinfectResult">

View File

@@ -41,6 +41,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
left join bas_sheep bs on s.sheep_id = bs.id
<where>
<!-- 根据ids数组查询 -->
<if test="ids != null and ids.length > 0">
AND s.id IN
<foreach collection="ids" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</if>
<if test="datetime != null "> and datetime = #{datetime}</if>
<if test="sheepNo != null and sheepNo != ''">and bs.manage_tags like concat('%',#{sheepNo},'%')</if>
<if test="sheepNos != null and sheepNos.length > 0">

View File

@@ -37,7 +37,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
bs.manage_tags sheep_no
from sw_immunity s
left join bas_sheep bs on s.sheep_id = bs.id
<where>
<where>
<!-- 根据ids数组查询 -->
<if test="ids != null and ids.length > 0">
AND s.id IN
<foreach collection="ids" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</if>
<if test="sheepId != null "> and sheep_id = #{sheepId}</if>
<if test="sheepType != null "> and sheep_type = #{sheepType}</if>
<if test="sheepNo != null and sheepNo != ''">and bs.manage_tags like concat('%',#{sheepNo},'%')</if>

View File

@@ -44,7 +44,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectQuarantineReportList" parameterType="QuarantineReport" resultMap="QuarantineReportResult">
<include refid="selectQuarantineReportVo"/>
<where>
<where>
<!-- 根据ids数组查询 -->
<if test="ids != null and ids.length > 0">
AND sqr.id IN
<foreach collection="ids" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</if>
<if test="sheepId != null "> and sheep_id = #{sheepId}</if>
<if test="sheepNo != null and sheepNo != ''">and bs.manage_tags like concat('%',#{sheepNo},'%')</if>
<if test="params.beginDatetime != null and params.beginDatetime != '' and params.endDatetime != null and params.endDatetime != ''"> and datetime between #{params.beginDatetime} and #{params.endDatetime}</if>

View File

@@ -19,7 +19,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectSwMedicineList" parameterType="SwMedicine" resultMap="SwMedicineResult">
<include refid="selectSwMedicineVo"/>
<where>
<where>
<if test="medica != null and medica != ''"> and medica = #{medica}</if>
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
<if test="medicType != null "> and medic_type = #{medicType}</if>

View File

@@ -63,7 +63,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
LEFT JOIN da_sheepfold ds ON ds.id = smu.sheepfold
LEFT JOIN bas_sheep bs ON bs.id = smu.sheep
<where>
<!-- 根据ids数组查询 -->
<if test="ids != null and ids.length > 0">
AND smu.id IN
<foreach collection="ids" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</if>
<!-- 2. 使用类型 -->
<if test="useType != null and useType != ''">
AND smu.use_type = #{useType}

View File

@@ -52,7 +52,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
left join bas_sheep bs on t.sheep_id = bs.id
left join sw_disease sd on t.disease_id = sd.id
left join sw_disease sd2 on t.disease_pid = sd2.id
<where>
<where>
<!-- 根据ids数组查询 -->
<if test="ids != null and ids.length > 0">
AND t.id IN
<foreach collection="ids" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</if>
<if test="sheepId != null "> and sheep_id = #{sheepId}</if>
<if test="sheepNo != null and sheepNo != ''">and bs.manage_tags like concat('%',#{sheepNo},'%')</if>
<if test="sheepNos != null and sheepNos.length > 0">

View File

@@ -15,13 +15,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<choose>
<!-- deptId = 0查询所有用户不限制部门 -->
<when test="deptId == 0">
SELECT DISTINCT u.user_id, u.nick_name, p.post_name, p.post_code
SELECT
MIN(u.user_id) as user_id,
u.nick_name,
MIN(p.post_name) as post_name,
MIN(p.post_code) as post_code
FROM sys_user u
JOIN sys_user_post up ON u.user_id = up.user_id
JOIN sys_post p ON up.post_id = p.post_id
WHERE p.post_code LIKE CONCAT('%', #{postCode}, '%')
<where>
<if test="postCode!=null and postCode!=''">
AND p.post_code LIKE CONCAT('%', #{postCode}, '%')
</if>
</where>
AND u.status = 0
AND u.del_flag = 0
GROUP BY u.nick_name
</when>
<!-- deptId != 0递归查询该部门及所有子部门 -->
@@ -33,14 +42,23 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
FROM sys_dept d
INNER JOIN dept_tree dt ON d.parent_id = dt.dept_id
)
SELECT DISTINCT u.user_id, u.nick_name, p.post_name, p.post_code
SELECT
MIN(u.user_id) as user_id,
u.nick_name,
MIN(p.post_name) as post_name,
MIN(p.post_code) as post_code
FROM dept_tree dt
JOIN sys_user u ON u.dept_id = dt.dept_id
JOIN sys_user_post up ON u.user_id = up.user_id
JOIN sys_post p ON up.post_id = p.post_id
WHERE p.post_code LIKE CONCAT('%', #{postCode}, '%')
<where>
<if test="postCode!=null and postCode!=''">
AND p.post_code LIKE CONCAT('%', #{postCode}, '%')
</if>
</where>
AND u.status = 0
AND u.del_flag = 0
GROUP BY u.nick_name
</otherwise>
</choose>
</select>