heheng
9 小时以前 334ae6d3ba9992f5f081c6800af486a19c019c38
查询统计优化
已修改2个文件
26 ■■■■■ 文件已修改
expert-system/src/main/java/com/gkhy/system/domain/ProjectManagement.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
expert-system/src/main/resources/mapper/system/ProjectManagementMapper.xml 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
expert-system/src/main/java/com/gkhy/system/domain/ProjectManagement.java
@@ -16,6 +16,7 @@
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.Date;
import java.util.List;
/**
@@ -48,6 +49,11 @@
    @ApiModelProperty(value = "处室",required = true)
    @NotNull(message = "处室不能为空")
    private Long deptId;
    @ApiModelProperty(value = "处室id筛选条件")
    @TableField(exist = false)
    private List<Long> deptIds;
    /**
     * 部门名称
@@ -364,4 +370,12 @@
    public void setProjectCode(String projectCode) {
        this.projectCode = projectCode;
    }
    public List<Long> getDeptIds() {
        return deptIds;
    }
    public void setDeptIds(List<Long> deptIds) {
        this.deptIds = deptIds;
    }
}
expert-system/src/main/resources/mapper/system/ProjectManagementMapper.xml
@@ -83,6 +83,12 @@
            <if test="projectName != null  and projectName != ''"> and project_name like concat('%', #{projectName}, '%')</if>
            <if test="projectCode != null  and projectCode != ''"> and project_code like concat('%', #{projectCode}, '%')</if>
            <if test="deptId != null "> and dept_id = #{deptId}</if>
            <if test="deptIds != null and deptIds.size() > 0">
                AND dept_id IN
                <foreach item="deptId" collection="deptIds" open="(" separator="," close=")">
                    #{deptId}
                </foreach>
            </if>
            <if test="deptName != null  and deptName != ''"> and dept_name like concat('%', #{deptName}, '%')</if>
            <if test="jobCategory != null  and jobCategory != ''"> and job_category like concat('%', #{jobCategory}, '%')</if>
            <if test="projectAddress != null  and projectAddress != ''"> and project_address = #{projectAddress}</if>
@@ -109,6 +115,12 @@
        <if test="projectName != null  and projectName != ''"> and a.project_name like concat('%', #{projectName}, '%')</if>
        <if test="projectCode != null  and projectCode != ''"> and a.project_code like concat('%', #{projectCode}, '%')</if>
        <if test="deptId != null "> and a.dept_id = #{deptId}</if>
        <if test="deptIds != null and deptIds.size() > 0">
            AND a.dept_id IN
            <foreach item="deptId" collection="deptIds" open="(" separator="," close=")">
                #{deptId}
            </foreach>
        </if>
        <if test="projectDateStart != null "> and date_format(a.project_date_start,'%Y%m%d') &gt;= date_format(#{projectDateStart},'%Y%m%d')</if>
        <if test="projectDateEnd != null "> and date_format(a.project_date_end,'%Y%m%d') &lt;= date_format(#{projectDateEnd},'%Y%m%d')</if>
        order BY a.dept_name asc ,c.`name` desc