生物安全导出修改
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -26,6 +26,7 @@ public class Deworm extends BaseEntity
|
||||
|
||||
/** $column.columnComment */
|
||||
private Long id;
|
||||
private Long[] ids;
|
||||
|
||||
private Long sheepId;
|
||||
|
||||
|
||||
@@ -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;
|
||||
/** 时间日期 */
|
||||
|
||||
@@ -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;
|
||||
|
||||
/** 比例 */
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
|
||||
@@ -28,6 +28,7 @@ public class SwMedicineUsage extends BaseEntity
|
||||
|
||||
/** id */
|
||||
private Integer id;
|
||||
private Long[] ids;
|
||||
|
||||
/** 使用名称 */
|
||||
@Excel(name = "使用名称",width = 20, needMerge = true)
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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">
|
||||
|
||||
@@ -43,6 +43,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<select id="selectDiagnosisList" parameterType="Diagnosis" resultMap="DiagnosisResult">
|
||||
<include refid="selectDiagnosisVo"/>
|
||||
<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">
|
||||
|
||||
@@ -44,6 +44,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
FROM sw_disinfect sd
|
||||
LEFT JOIN da_sheepfold ds ON ds.id = sd.sheepfold_id
|
||||
<where>1 = 1
|
||||
<!-- 根据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>
|
||||
@@ -64,7 +71,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
${params.dataScope}
|
||||
</where>
|
||||
ORDER BY datetime DESC
|
||||
|
||||
</select>
|
||||
|
||||
<select id="selectDisinfectById" parameterType="Long" resultMap="DisinfectResult">
|
||||
|
||||
@@ -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">
|
||||
|
||||
@@ -38,6 +38,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
from sw_immunity s
|
||||
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="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>
|
||||
|
||||
@@ -45,6 +45,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<select id="selectQuarantineReportList" parameterType="QuarantineReport" resultMap="QuarantineReportResult">
|
||||
<include refid="selectQuarantineReportVo"/>
|
||||
<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>
|
||||
|
||||
@@ -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}
|
||||
|
||||
@@ -53,6 +53,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
left join sw_disease sd on t.disease_id = sd.id
|
||||
left join sw_disease sd2 on t.disease_pid = sd2.id
|
||||
<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">
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user