8 changed files with 479 additions and 46 deletions
@ -1,8 +1,52 @@ |
|||
package com.zdxt.enforcementcode.mapper.enterprise; |
|||
|
|||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|||
import com.zdxt.enforcementcode.domain.EnterpriseComplaint; |
|||
import com.zdxt.enforcementcode.domain.vo.enterprise.AppEnterpriseComplaintVo; |
|||
import org.apache.ibatis.annotations.Param; |
|||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus; |
|||
|
|||
import java.util.Date; |
|||
import java.util.List; |
|||
|
|||
public interface AppEnterpriseComplaintMapper extends BaseMapperPlus<EnterpriseComplaint, AppEnterpriseComplaintVo> { |
|||
|
|||
/** |
|||
* 查询行政和非行政未被投诉的检查记录列表(UNION ALL合并两个表) |
|||
* @param enterpriseNumber 企业信用代码 |
|||
* @param searchValue 关键字搜索 |
|||
* @param checkCategoryCode 执法类别代码 |
|||
* @param beginTime 开始时间 |
|||
* @param endTime 结束时间 |
|||
* @param deptList 部门ID列表 |
|||
* @return 检查结果列表 |
|||
*/ |
|||
List<AppEnterpriseComplaintVo> selectAllCheckList( |
|||
@Param("enterpriseNumber") String enterpriseNumber, |
|||
@Param("searchValue") String searchValue, |
|||
@Param("checkCategoryCode") String checkCategoryCode, |
|||
@Param("beginTime") Date beginTime, |
|||
@Param("endTime") Date endTime, |
|||
@Param("deptList") List<String> deptList, |
|||
Page<AppEnterpriseComplaintVo> page |
|||
); |
|||
|
|||
/** |
|||
* 统计行政和非行政未被投诉的检查记录总数 |
|||
* @param enterpriseNumber 企业信用代码 |
|||
* @param searchValue 关键字搜索 |
|||
* @param checkCategoryCode 执法类别代码 |
|||
* @param beginTime 开始时间 |
|||
* @param endTime 结束时间 |
|||
* @param deptList 部门ID列表 |
|||
* @return 总数 |
|||
*/ |
|||
Long countAllCheckList( |
|||
@Param("enterpriseNumber") String enterpriseNumber, |
|||
@Param("searchValue") String searchValue, |
|||
@Param("checkCategoryCode") String checkCategoryCode, |
|||
@Param("beginTime") Date beginTime, |
|||
@Param("endTime") Date endTime, |
|||
@Param("deptList") List<String> deptList |
|||
); |
|||
} |
|||
|
|||
@ -0,0 +1,157 @@ |
|||
<?xml version="1.0" encoding="UTF-8" ?> |
|||
<!DOCTYPE mapper |
|||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
|||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|||
<mapper namespace="com.zdxt.enforcementcode.mapper.enterprise.AppEnterpriseComplaintMapper"> |
|||
|
|||
<!-- 查询行政和非行政未被投诉的检查记录列表 --> |
|||
<select id="selectAllCheckList" resultType="com.zdxt.enforcementcode.domain.vo.enterprise.AppEnterpriseComplaintVo"> |
|||
SELECT * FROM ( |
|||
<!-- 行政检查 --> |
|||
SELECT |
|||
er.id, |
|||
er.law_enforcer AS lawEnforcer, |
|||
er.law_enforcer_id AS lawEnforcerId, |
|||
er.law_enforcer_id_two AS lawEnforcerOtherId, |
|||
er.law_enforcer_two AS lawEnforcerOther, |
|||
er.law_enforcement_item_text AS title, |
|||
er.check_category AS lawEnforcementType, |
|||
0 AS dataType, |
|||
er.bureau_dept_id AS bureauDeptId, |
|||
er.bureau_dept_name AS bureauDeptName , |
|||
er.enforcement_time as enforcementTime |
|||
FROM enforcement_registration er |
|||
WHERE er.is_submit = 1 |
|||
AND er.is_complaint = 0 |
|||
AND er.enterprise_number = #{enterpriseNumber} |
|||
|
|||
<if test="checkCategoryCode != null and checkCategoryCode != ''"> |
|||
AND er.check_category = #{checkCategoryCode} |
|||
</if> |
|||
|
|||
<if test="beginTime != null"> |
|||
AND er.enforcement_time >= #{beginTime} |
|||
</if> |
|||
|
|||
<if test="endTime != null"> |
|||
AND er.enforcement_time <= #{endTime} |
|||
</if> |
|||
|
|||
<if test="deptList != null and deptList.size() > 0"> |
|||
AND er.dept_id IN |
|||
<foreach collection="deptList" item="deptId" open="(" separator="," close=")"> |
|||
#{deptId} |
|||
</foreach> |
|||
</if> |
|||
|
|||
UNION ALL |
|||
|
|||
<!-- 非行政检查 --> |
|||
SELECT |
|||
ner.id, |
|||
ner.law_enforcer AS lawEnforcer, |
|||
ner.law_enforcer_id AS lawEnforcerId, |
|||
ner.law_enforcer_id_other AS lawEnforcerOtherId, |
|||
ner.law_enforcer_other AS lawEnforcerOther, |
|||
ner.law_enforcement_item_text AS title, |
|||
ner.law_enforcement_type_text AS lawEnforcementType, |
|||
1 AS dataType, |
|||
ner.bureau_dept_id AS bureauDeptId, |
|||
ner.bureau_dept_name AS bureauDeptName, |
|||
ner.enforcement_time as enforcementTime |
|||
FROM non_enforcement_registration ner |
|||
WHERE ner.has_submit = 1 |
|||
AND ner.has_complaint = 0 |
|||
AND ner.enterprise_number = #{enterpriseNumber} |
|||
|
|||
<if test="beginTime != null"> |
|||
AND ner.enforcement_time >= #{beginTime} |
|||
</if> |
|||
|
|||
<if test="endTime != null"> |
|||
AND ner.enforcement_time <= #{endTime} |
|||
</if> |
|||
|
|||
<if test="deptList != null and deptList.size() > 0"> |
|||
AND ner.law_enforcer_id IN |
|||
<foreach collection="deptList" item="deptId" open="(" separator="," close=")"> |
|||
#{deptId} |
|||
</foreach> |
|||
</if> |
|||
) combined |
|||
|
|||
<!-- 关键字搜索 --> |
|||
<if test="searchValue != null and searchValue != ''"> |
|||
WHERE complaintRecordItem LIKE CONCAT('%', #{searchValue}, '%') |
|||
OR complaintDepartments LIKE CONCAT('%', #{searchValue}, '%') |
|||
OR linkman LIKE CONCAT('%', #{searchValue}, '%') |
|||
OR enterpriseName LIKE CONCAT('%', #{searchValue}, '%') |
|||
</if> |
|||
|
|||
ORDER BY enforcementTime DESC |
|||
</select> |
|||
|
|||
<!-- 统计行政和非行政未被投诉的检查记录总数 --> |
|||
<select id="countAllCheckList" resultType="java.lang.Long"> |
|||
SELECT COUNT(*) FROM ( |
|||
<!-- 行政检查 --> |
|||
SELECT er.id |
|||
FROM enforcement_registration er |
|||
WHERE er.is_submit = 1 |
|||
AND er.is_complaint = 0 |
|||
AND er.enterprise_number = #{enterpriseNumber} |
|||
|
|||
<if test="checkCategoryCode != null and checkCategoryCode != ''"> |
|||
AND er.check_category = #{checkCategoryCode} |
|||
</if> |
|||
|
|||
<if test="beginTime != null"> |
|||
AND er.enforcement_time >= #{beginTime} |
|||
</if> |
|||
|
|||
<if test="endTime != null"> |
|||
AND er.enforcement_time <= #{endTime} |
|||
</if> |
|||
|
|||
<if test="deptList != null and deptList.size() > 0"> |
|||
AND er.dept_id IN |
|||
<foreach collection="deptList" item="deptId" open="(" separator="," close=")"> |
|||
#{deptId} |
|||
</foreach> |
|||
</if> |
|||
|
|||
UNION ALL |
|||
|
|||
<!-- 非行政检查 --> |
|||
SELECT ner.id |
|||
FROM non_enforcement_registration ner |
|||
WHERE ner.has_submit = 1 |
|||
AND ner.has_complaint = 0 |
|||
AND ner.enterprise_number = #{enterpriseNumber} |
|||
|
|||
<if test="beginTime != null"> |
|||
AND ner.enforcement_time >= #{beginTime} |
|||
</if> |
|||
|
|||
<if test="endTime != null"> |
|||
AND ner.enforcement_time <= #{endTime} |
|||
</if> |
|||
|
|||
<if test="deptList != null and deptList.size() > 0"> |
|||
AND ner.law_enforcer_id IN |
|||
<foreach collection="deptList" item="deptId" open="(" separator="," close=")"> |
|||
#{deptId} |
|||
</foreach> |
|||
</if> |
|||
) combined |
|||
|
|||
<!-- 关键字搜索 --> |
|||
<if test="searchValue != null and searchValue != ''"> |
|||
WHERE complaintRecordItem LIKE CONCAT('%', #{searchValue}, '%') |
|||
OR complaintDepartments LIKE CONCAT('%', #{searchValue}, '%') |
|||
OR linkman LIKE CONCAT('%', #{searchValue}, '%') |
|||
OR enterpriseName LIKE CONCAT('%', #{searchValue}, '%') |
|||
</if> |
|||
</select> |
|||
|
|||
</mapper> |
|||
Loading…
Reference in new issue