生物安全导出修改
This commit is contained in:
@@ -6,9 +6,9 @@ spring:
|
|||||||
druid:
|
druid:
|
||||||
# 主库数据源
|
# 主库数据源
|
||||||
master:
|
master:
|
||||||
# url: jdbc:mysql://localhost:3306/zhyc?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
# url: jdbc:mysql://146.56.214.124:3306/zhyc?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||||
# username: root
|
# username: zhyc
|
||||||
# password: 123456
|
# password: zhyc1234
|
||||||
url: jdbc:mysql://118.182.97.76:3306/zhyc?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
url: jdbc:mysql://118.182.97.76:3306/zhyc?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||||
username: zhyc
|
username: zhyc
|
||||||
password: yszh123
|
password: yszh123
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ public class Deworm extends BaseEntity
|
|||||||
|
|
||||||
/** $column.columnComment */
|
/** $column.columnComment */
|
||||||
private Long id;
|
private Long id;
|
||||||
|
private Long[] ids;
|
||||||
|
|
||||||
private Long sheepId;
|
private Long sheepId;
|
||||||
|
|
||||||
|
|||||||
@@ -26,9 +26,10 @@ public class Diagnosis extends BaseEntity
|
|||||||
|
|
||||||
/** $column.columnComment */
|
/** $column.columnComment */
|
||||||
private Long id;
|
private Long id;
|
||||||
|
private Long[] ids;
|
||||||
|
|
||||||
/** 治疗记录id */
|
/** 治疗记录id */
|
||||||
@Excel(name = "治疗记录")
|
// @Excel(name = "治疗记录")
|
||||||
private Long treatId;
|
private Long treatId;
|
||||||
private Integer[] treatIds;
|
private Integer[] treatIds;
|
||||||
/** 时间日期 */
|
/** 时间日期 */
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ public class Disinfect extends BaseEntity
|
|||||||
|
|
||||||
/** id */
|
/** id */
|
||||||
private Long id;
|
private Long id;
|
||||||
|
private Long[] ids;
|
||||||
|
|
||||||
/** 羊舍id */
|
/** 羊舍id */
|
||||||
@Excel(name = "羊舍")
|
@Excel(name = "羊舍")
|
||||||
@@ -43,12 +44,12 @@ public class Disinfect extends BaseEntity
|
|||||||
@Excel(name = "技术员")
|
@Excel(name = "技术员")
|
||||||
private String technician;
|
private String technician;
|
||||||
|
|
||||||
/** 消毒方式 */
|
/** 消毒方式:0喷雾 1撒布 2浸泡 3熏蒸 4其他 */
|
||||||
@Excel(name = "消毒方式")
|
@Excel(name = "消毒方式", readConverterExp = "0=喷雾,1=撒布,2=浸泡,3=熏蒸,4=其他")
|
||||||
private String way;
|
private String way;
|
||||||
|
|
||||||
/** 药品使用记录id */
|
/** 药品使用记录id */
|
||||||
@Excel(name = "药品使用记录id")
|
// @Excel(name = "药品使用记录id")
|
||||||
private Integer usageId;
|
private Integer usageId;
|
||||||
|
|
||||||
/** 比例 */
|
/** 比例 */
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ public class Health extends BaseEntity
|
|||||||
|
|
||||||
/** $column.columnComment */
|
/** $column.columnComment */
|
||||||
private Long id;
|
private Long id;
|
||||||
|
private Long[] ids;
|
||||||
|
|
||||||
/** 保健日期 */
|
/** 保健日期 */
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
@@ -57,7 +58,7 @@ public class Health extends BaseEntity
|
|||||||
private Long parity;
|
private Long parity;
|
||||||
|
|
||||||
/** 用药记录 */
|
/** 用药记录 */
|
||||||
@Excel(name = "用药记录")
|
// @Excel(name = "用药记录")
|
||||||
private Integer usageId;
|
private Integer usageId;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ public class Immunity extends BaseEntity
|
|||||||
|
|
||||||
/** $column.columnComment */
|
/** $column.columnComment */
|
||||||
private Long id;
|
private Long id;
|
||||||
|
private Long[] ids;
|
||||||
|
|
||||||
/** 羊只id */
|
/** 羊只id */
|
||||||
private Long sheepId;
|
private Long sheepId;
|
||||||
@@ -59,7 +60,7 @@ public class Immunity extends BaseEntity
|
|||||||
private Long parity;
|
private Long parity;
|
||||||
|
|
||||||
/** 使用记录 */
|
/** 使用记录 */
|
||||||
@Excel(name = "使用记录")
|
// @Excel(name = "使用记录")
|
||||||
private Integer usageId;
|
private Integer usageId;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ public class SwMedicineUsage extends BaseEntity
|
|||||||
|
|
||||||
/** id */
|
/** id */
|
||||||
private Integer id;
|
private Integer id;
|
||||||
|
private Long[] ids;
|
||||||
|
|
||||||
/** 使用名称 */
|
/** 使用名称 */
|
||||||
@Excel(name = "使用名称",width = 20, needMerge = true)
|
@Excel(name = "使用名称",width = 20, needMerge = true)
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ public class Treatment extends BaseEntity
|
|||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
private Long id;
|
private Long id;
|
||||||
|
private Long[] ids;
|
||||||
|
|
||||||
/** 诊疗记录id */
|
/** 诊疗记录id */
|
||||||
private Long diagId;
|
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")
|
@GetMapping("/getUser")
|
||||||
public AjaxResult getUserPost(String postCode){
|
public AjaxResult getUserPost(String postCode){
|
||||||
User user = new User();
|
User user = new User();
|
||||||
user.setPostCode(postCode);
|
if (postCode != null){
|
||||||
|
user.setPostName(postCode);
|
||||||
|
}
|
||||||
List<User> list = userService.getUserListByCode(user);
|
List<User> list = userService.getUserListByCode(user);
|
||||||
return AjaxResult.success(list);
|
return AjaxResult.success(list);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,6 +34,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<select id="selectDewormList" parameterType="Deworm" resultMap="DewormResult">
|
<select id="selectDewormList" parameterType="Deworm" resultMap="DewormResult">
|
||||||
<include refid="selectDewormVo"/>
|
<include refid="selectDewormVo"/>
|
||||||
<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="sheepId != null">and sheep_id = #{sheepId}</if>
|
||||||
<if test="sheepNo != null and sheepNo != ''">and bs.manage_tags like concat('%',#{sheepNo},'%')</if>
|
<if test="sheepNo != null and sheepNo != ''">and bs.manage_tags like concat('%',#{sheepNo},'%')</if>
|
||||||
<if test="sheepNos != null and sheepNos.length > 0">
|
<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">
|
<select id="selectDiagnosisList" parameterType="Diagnosis" resultMap="DiagnosisResult">
|
||||||
<include refid="selectDiagnosisVo"/>
|
<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="sheepId != null "> and sd.sheep_id = #{sheepId}</if>
|
||||||
<if test="sheepNo != null"> and sf.bs_manage_tags like concat('%', #{sheepNo}, '%')</if>
|
<if test="sheepNo != null"> and sf.bs_manage_tags like concat('%', #{sheepNo}, '%')</if>
|
||||||
<if test="sheepNos != null and sheepNos.length > 0">
|
<if test="sheepNos != null and sheepNos.length > 0">
|
||||||
|
|||||||
@@ -41,30 +41,36 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
sd.create_by,
|
sd.create_by,
|
||||||
sd.create_time,
|
sd.create_time,
|
||||||
ds.sheepfold_name
|
ds.sheepfold_name
|
||||||
FROM sw_disinfect sd
|
FROM sw_disinfect sd
|
||||||
LEFT JOIN da_sheepfold ds ON ds.id = sd.sheepfold_id
|
LEFT JOIN da_sheepfold ds ON ds.id = sd.sheepfold_id
|
||||||
<where>1 = 1
|
<where>1 = 1
|
||||||
<if test="sheepfoldId != null"> AND sd.sheepfold_id = #{sheepfoldId}</if>
|
<!-- 根据ids数组查询 -->
|
||||||
<if test="datetime != null"> AND sd.datetime = #{datetime}</if>
|
<if test="ids != null and ids.length > 0">
|
||||||
<if test="technician != null and technician != ''"> AND sd.technician = #{technician}</if>
|
AND sd.id IN
|
||||||
<if test="way != null and way != ''"> AND sd.way = #{way}</if>
|
<foreach collection="ids" item="id" open="(" separator="," close=")">
|
||||||
<if test="usageId != null"> AND sd.usage_id = #{usageId}</if>
|
#{id}
|
||||||
<if test="ratio != null and ratio != ''"> AND sd.ratio = #{ratio}</if>
|
</foreach>
|
||||||
<if test="comment != null and comment != ''"> AND sd.comment = #{comment}</if>
|
</if>
|
||||||
<!-- 子表过滤条件:仅保留满足药品名称的记录 -->
|
<if test="sheepfoldId != null"> AND sd.sheepfold_id = #{sheepfoldId}</if>
|
||||||
<if test="mediName != null and mediName != ''">
|
<if test="datetime != null"> AND sd.datetime = #{datetime}</if>
|
||||||
AND EXISTS (
|
<if test="technician != null and technician != ''"> AND sd.technician = #{technician}</if>
|
||||||
SELECT 1
|
<if test="way != null and way != ''"> AND sd.way = #{way}</if>
|
||||||
FROM sw_medicine_usage_details mud
|
<if test="usageId != null"> AND sd.usage_id = #{usageId}</if>
|
||||||
JOIN sw_medicine sm ON sm.id = mud.medi_id
|
<if test="ratio != null and ratio != ''"> AND sd.ratio = #{ratio}</if>
|
||||||
WHERE mud.medi_usage = sd.usage_id
|
<if test="comment != null and comment != ''"> AND sd.comment = #{comment}</if>
|
||||||
AND sm.name like concat('%',#{mediName},'%')
|
<!-- 子表过滤条件:仅保留满足药品名称的记录 -->
|
||||||
)
|
<if test="mediName != null and mediName != ''">
|
||||||
</if>
|
AND EXISTS (
|
||||||
${params.dataScope}
|
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>
|
</where>
|
||||||
ORDER BY datetime DESC
|
ORDER BY datetime DESC
|
||||||
|
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectDisinfectById" parameterType="Long" resultMap="DisinfectResult">
|
<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
|
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="datetime != null "> and datetime = #{datetime}</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="sheepNo != null and sheepNo != ''">and bs.manage_tags like concat('%',#{sheepNo},'%')</if>
|
||||||
<if test="sheepNos != null and sheepNos.length > 0">
|
<if test="sheepNos != null and sheepNos.length > 0">
|
||||||
|
|||||||
@@ -38,6 +38,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
from sw_immunity s
|
from sw_immunity s
|
||||||
left join bas_sheep bs on s.sheep_id = bs.id
|
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="sheepId != null "> and sheep_id = #{sheepId}</if>
|
||||||
<if test="sheepType != null "> and sheep_type = #{sheepType}</if>
|
<if test="sheepType != null "> and sheep_type = #{sheepType}</if>
|
||||||
<if test="sheepNo != null and sheepNo != ''">and bs.manage_tags like concat('%',#{sheepNo},'%')</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">
|
<select id="selectQuarantineReportList" parameterType="QuarantineReport" resultMap="QuarantineReportResult">
|
||||||
<include refid="selectQuarantineReportVo"/>
|
<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="sheepId != null "> and sheep_id = #{sheepId}</if>
|
||||||
<if test="sheepNo != null and sheepNo != ''">and bs.manage_tags like concat('%',#{sheepNo},'%')</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>
|
<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 da_sheepfold ds ON ds.id = smu.sheepfold
|
||||||
LEFT JOIN bas_sheep bs ON bs.id = smu.sheep
|
LEFT JOIN bas_sheep bs ON bs.id = smu.sheep
|
||||||
<where>
|
<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. 使用类型 -->
|
<!-- 2. 使用类型 -->
|
||||||
<if test="useType != null and useType != ''">
|
<if test="useType != null and useType != ''">
|
||||||
AND smu.use_type = #{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 sd on t.disease_id = sd.id
|
||||||
left join sw_disease sd2 on t.disease_pid = sd2.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="sheepId != null "> and sheep_id = #{sheepId}</if>
|
||||||
<if test="sheepNo != null and sheepNo != ''">and bs.manage_tags like concat('%',#{sheepNo},'%')</if>
|
<if test="sheepNo != null and sheepNo != ''">and bs.manage_tags like concat('%',#{sheepNo},'%')</if>
|
||||||
<if test="sheepNos != null and sheepNos.length > 0">
|
<if test="sheepNos != null and sheepNos.length > 0">
|
||||||
|
|||||||
@@ -15,13 +15,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<choose>
|
<choose>
|
||||||
<!-- deptId = 0:查询所有用户,不限制部门 -->
|
<!-- deptId = 0:查询所有用户,不限制部门 -->
|
||||||
<when test="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
|
FROM sys_user u
|
||||||
JOIN sys_user_post up ON u.user_id = up.user_id
|
JOIN sys_user_post up ON u.user_id = up.user_id
|
||||||
JOIN sys_post p ON up.post_id = p.post_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.status = 0
|
||||||
AND u.del_flag = 0
|
AND u.del_flag = 0
|
||||||
|
GROUP BY u.nick_name
|
||||||
</when>
|
</when>
|
||||||
|
|
||||||
<!-- deptId != 0:递归查询该部门及所有子部门 -->
|
<!-- deptId != 0:递归查询该部门及所有子部门 -->
|
||||||
@@ -33,14 +42,23 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
FROM sys_dept d
|
FROM sys_dept d
|
||||||
INNER JOIN dept_tree dt ON d.parent_id = dt.dept_id
|
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
|
FROM dept_tree dt
|
||||||
JOIN sys_user u ON u.dept_id = dt.dept_id
|
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_user_post up ON u.user_id = up.user_id
|
||||||
JOIN sys_post p ON up.post_id = p.post_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.status = 0
|
||||||
AND u.del_flag = 0
|
AND u.del_flag = 0
|
||||||
|
GROUP BY u.nick_name
|
||||||
</otherwise>
|
</otherwise>
|
||||||
</choose>
|
</choose>
|
||||||
</select>
|
</select>
|
||||||
|
|||||||
Reference in New Issue
Block a user