12 changed files with 1624 additions and 55 deletions
@ -0,0 +1,60 @@ |
|||
package com.zdxt.enforcementcode.controller.app.enforcement; |
|||
|
|||
import com.zdxt.enforcementcode.domain.bo.NonEnforcementRegistrationBo; |
|||
import com.zdxt.enforcementcode.domain.vo.NonEnforcementRegistrationVo; |
|||
import com.zdxt.enforcementcode.service.INonEnforcementRegistrationService; |
|||
import org.dromara.common.core.domain.R; |
|||
import org.dromara.common.mybatis.core.page.TableDataInfo; |
|||
import org.dromara.common.web.core.BaseController; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 执法端-非行政执法登记Controller |
|||
* |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("/app-enf/nonRegistration") |
|||
public class AppNonEnforcementRegistrationController extends BaseController { |
|||
|
|||
@Autowired private INonEnforcementRegistrationService enforcementRegistrationService; |
|||
|
|||
/** |
|||
* 执法端-非行政新增保存执法登记 |
|||
*/ |
|||
@PostMapping("/add") |
|||
@ResponseBody |
|||
public R<Void> addSave(@RequestBody NonEnforcementRegistrationBo bo) |
|||
{ |
|||
|
|||
int result = enforcementRegistrationService.insertNonEnforcementRegistration(bo); |
|||
return result > 0 ? R.ok() : R.fail("新增失败"); |
|||
} |
|||
|
|||
/** |
|||
* 执法端-非行政查询执法登记列表 |
|||
*/ |
|||
@GetMapping("/queryList") |
|||
public TableDataInfo queryList(NonEnforcementRegistrationBo bo) |
|||
{ |
|||
int total = enforcementRegistrationService.getListTotal(bo); |
|||
List<NonEnforcementRegistrationVo> list = enforcementRegistrationService.selectNonEnforcementRegistrationList(bo); |
|||
TableDataInfo<NonEnforcementRegistrationVo> rspData = new TableDataInfo<>(list, total); |
|||
rspData.setCode(0); |
|||
return rspData; |
|||
} |
|||
|
|||
/** |
|||
* 执法端-非行政查询执法登记列表 |
|||
*/ |
|||
@GetMapping("/queryById") |
|||
public R<NonEnforcementRegistrationVo> queryById(String id) |
|||
{ |
|||
NonEnforcementRegistrationVo registrations = enforcementRegistrationService.selectNonEnforcementRegistrationById(id); |
|||
return R.ok(registrations); |
|||
} |
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,243 @@ |
|||
package com.zdxt.enforcementcode.domain.bo; |
|||
|
|||
import com.zdxt.enforcementcode.domain.NonEnforcementRegistration; |
|||
import org.dromara.common.mybatis.core.domain.BaseEntity; |
|||
import org.dromara.common.core.validate.AddGroup; |
|||
import org.dromara.common.core.validate.EditGroup; |
|||
import io.github.linpeilie.annotations.AutoMapper; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
import jakarta.validation.constraints.*; |
|||
import java.util.Date; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 非行政执法登记业务对象 non_enforcement_registration |
|||
* |
|||
* @author niujiyi |
|||
* @date 2026-05-19 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@AutoMapper(target = NonEnforcementRegistration.class, reverseConvertGenerate = false) |
|||
public class NonEnforcementRegistrationBo extends BaseEntity { |
|||
|
|||
/** |
|||
* 主键ID |
|||
*/ |
|||
private String id; |
|||
|
|||
/** |
|||
* 被执法企业 |
|||
*/ |
|||
private String enterpriseName; |
|||
|
|||
/** |
|||
* |
|||
*/ |
|||
private String enterpriseNumber; |
|||
|
|||
/** |
|||
* 执法时间 |
|||
*/ |
|||
private Date enforcementTime; |
|||
|
|||
/** |
|||
* 执法人员姓名 |
|||
*/ |
|||
private String lawEnforcer; |
|||
|
|||
/** |
|||
* 执法人员ID |
|||
*/ |
|||
private String lawEnforcerId; |
|||
|
|||
/** |
|||
* 其他执法人员姓名 |
|||
*/ |
|||
private String lawEnforcerOther; |
|||
|
|||
/** |
|||
* 其他执法人员ID |
|||
*/ |
|||
private String lawEnforcerIdOther; |
|||
|
|||
/** |
|||
* 执法(入企)类别 0 其他 |
|||
*/ |
|||
private Long lawEnforcementType; |
|||
|
|||
/** |
|||
* 执法(入企)类别 |
|||
*/ |
|||
private String lawEnforcementTypeText; |
|||
|
|||
/** |
|||
* 执法(入企)事项 0 其他 |
|||
*/ |
|||
private Long lawEnforcementItem; |
|||
|
|||
/** |
|||
* 执法(入企)事项 |
|||
*/ |
|||
private String lawEnforcementItemText; |
|||
|
|||
/** |
|||
* 执法(活动)依据 |
|||
*/ |
|||
private String lawEnforcementBasis; |
|||
|
|||
/** |
|||
* 执法(活动)依据 |
|||
*/ |
|||
private String lawEnforcementBasisText; |
|||
|
|||
/** |
|||
* 备注 |
|||
*/ |
|||
private String remark; |
|||
|
|||
/** |
|||
* 执法结果 0 合格 1 不合格 |
|||
*/ |
|||
private Long reslut; |
|||
|
|||
/** |
|||
* 数据状态 0 正常 1 取消 |
|||
*/ |
|||
private Long status; |
|||
|
|||
/** |
|||
* 是否删除 0 否 1 是 |
|||
*/ |
|||
private Long hasDelete; |
|||
|
|||
/** |
|||
* 是否投诉 0 否 1 是 |
|||
*/ |
|||
private Long hasComplaint; |
|||
|
|||
/** |
|||
* 数据保存或提交 0 保存 1提交 |
|||
*/ |
|||
private Long hasSubmit; |
|||
|
|||
/** |
|||
* 是否评价 0 否 1 是 |
|||
*/ |
|||
private Long hasEvaluate; |
|||
|
|||
/** |
|||
* 预告id |
|||
*/ |
|||
private String lawId; |
|||
|
|||
/** |
|||
* 预告 |
|||
*/ |
|||
private String lawText; |
|||
|
|||
/** |
|||
* 执法主体部门id |
|||
*/ |
|||
private String bureauDeptId; |
|||
|
|||
/** |
|||
* 执法主体 |
|||
*/ |
|||
private String bureauDeptName; |
|||
|
|||
/** |
|||
* 执法主体部门统一信用代码 |
|||
*/ |
|||
private String creditcode; |
|||
|
|||
/** |
|||
* 用户id |
|||
*/ |
|||
private String userId; |
|||
|
|||
/** |
|||
* 部门ID |
|||
*/ |
|||
private String deptId; |
|||
|
|||
/** |
|||
* 企业注册地址 |
|||
*/ |
|||
private String enterpriseAddress; |
|||
|
|||
/** |
|||
* 企业注册区 |
|||
*/ |
|||
private String district; |
|||
|
|||
/** |
|||
* 企业注册街道 |
|||
*/ |
|||
private String street; |
|||
|
|||
/** |
|||
* 未扫码原因 |
|||
*/ |
|||
private String reason; |
|||
|
|||
private List<String> fileList; |
|||
|
|||
/** |
|||
* 日期类型:1-本月,2-本季度,3-本年 |
|||
*/ |
|||
private Integer dateType; |
|||
|
|||
/** |
|||
* 日期搜索类型:year-年,quarter-季度,month-月,selectTime-自定义时间 |
|||
*/ |
|||
private String dateSearch; |
|||
|
|||
/** |
|||
* 区域 |
|||
*/ |
|||
private String area; |
|||
|
|||
/** |
|||
* 年份 |
|||
*/ |
|||
private String year; |
|||
|
|||
/** |
|||
* 季度 |
|||
*/ |
|||
private String quarter; |
|||
|
|||
/** |
|||
* 月份 |
|||
*/ |
|||
private String month; |
|||
|
|||
/** |
|||
* 开始时间 |
|||
*/ |
|||
private String startTime; |
|||
|
|||
/** |
|||
* 结束时间 |
|||
*/ |
|||
private String endTime; |
|||
|
|||
/** |
|||
* 搜索值 |
|||
*/ |
|||
private String searchValue; |
|||
|
|||
/** |
|||
* 区域文本(用于SQL查询) |
|||
*/ |
|||
private String areaText; |
|||
|
|||
/** |
|||
* 街道文本(用于SQL查询) |
|||
*/ |
|||
private String streetText; |
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,236 @@ |
|||
package com.zdxt.enforcementcode.domain.vo; |
|||
|
|||
import java.util.Date; |
|||
|
|||
import cn.idev.excel.annotation.ExcelIgnoreUnannotated; |
|||
import cn.idev.excel.annotation.ExcelProperty; |
|||
import com.zdxt.enforcementcode.domain.NonEnforcementRegistration; |
|||
import io.github.linpeilie.annotations.AutoMapper; |
|||
import lombok.Data; |
|||
|
|||
import java.io.Serial; |
|||
import java.io.Serializable; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
|
|||
/** |
|||
* 非行政执法登记视图对象 non_enforcement_registration |
|||
* |
|||
* @author niujiyi |
|||
* @date 2026-05-19 |
|||
*/ |
|||
@Data |
|||
@ExcelIgnoreUnannotated |
|||
@AutoMapper(target = NonEnforcementRegistration.class) |
|||
public class NonEnforcementRegistrationVo implements Serializable { |
|||
|
|||
@Serial |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 主键ID |
|||
*/ |
|||
@ExcelProperty(value = "主键ID") |
|||
private String id; |
|||
|
|||
/** |
|||
* 被执法企业 |
|||
*/ |
|||
@ExcelProperty(value = "被执法企业") |
|||
private String enterpriseName; |
|||
|
|||
/** |
|||
* |
|||
*/ |
|||
@ExcelProperty(value = "") |
|||
private String enterpriseNumber; |
|||
|
|||
/** |
|||
* 执法时间 |
|||
*/ |
|||
@ExcelProperty(value = "执法时间") |
|||
private Date enforcementTime; |
|||
|
|||
/** |
|||
* 执法人员姓名 |
|||
*/ |
|||
@ExcelProperty(value = "执法人员姓名") |
|||
private String lawEnforcer; |
|||
|
|||
/** |
|||
* 执法人员ID |
|||
*/ |
|||
@ExcelProperty(value = "执法人员ID") |
|||
private String lawEnforcerId; |
|||
|
|||
/** |
|||
* 其他执法人员姓名 |
|||
*/ |
|||
@ExcelProperty(value = "其他执法人员姓名") |
|||
private String lawEnforcerOther; |
|||
|
|||
/** |
|||
* 其他执法人员ID |
|||
*/ |
|||
@ExcelProperty(value = "其他执法人员ID") |
|||
private String lawEnforcerIdOther; |
|||
|
|||
/** |
|||
* 执法(入企)类别 0 其他 |
|||
*/ |
|||
@ExcelProperty(value = "执法(入企)类别 0 其他") |
|||
private Long lawEnforcementType; |
|||
|
|||
/** |
|||
* 执法(入企)类别 |
|||
*/ |
|||
@ExcelProperty(value = "执法(入企)类别") |
|||
private String lawEnforcementTypeText; |
|||
|
|||
/** |
|||
* 执法(入企)事项 0 其他 |
|||
*/ |
|||
@ExcelProperty(value = "执法(入企)事项 0 其他") |
|||
private Long lawEnforcementItem; |
|||
|
|||
/** |
|||
* 执法(入企)事项 |
|||
*/ |
|||
@ExcelProperty(value = "执法(入企)事项") |
|||
private String lawEnforcementItemText; |
|||
|
|||
/** |
|||
* 执法(活动)依据 |
|||
*/ |
|||
@ExcelProperty(value = "执法(活动)依据") |
|||
private String lawEnforcementBasis; |
|||
|
|||
/** |
|||
* 执法(活动)依据 |
|||
*/ |
|||
@ExcelProperty(value = "执法(活动)依据") |
|||
private String lawEnforcementBasisText; |
|||
|
|||
/** |
|||
* 备注 |
|||
*/ |
|||
@ExcelProperty(value = "备注") |
|||
private String remark; |
|||
|
|||
/** |
|||
* 执法结果 0 合格 1 不合格 |
|||
*/ |
|||
@ExcelProperty(value = "执法结果 0 合格 1 不合格") |
|||
private Long reslut; |
|||
|
|||
/** |
|||
* 数据状态 0 正常 1 取消 |
|||
*/ |
|||
@ExcelProperty(value = "数据状态 0 正常 1 取消") |
|||
private Long status; |
|||
|
|||
/** |
|||
* 是否删除 0 否 1 是 |
|||
*/ |
|||
@ExcelProperty(value = "是否删除 0 否 1 是") |
|||
private Long hasDelete; |
|||
|
|||
/** |
|||
* 是否投诉 0 否 1 是 |
|||
*/ |
|||
@ExcelProperty(value = "是否投诉 0 否 1 是") |
|||
private Long hasComplaint; |
|||
|
|||
/** |
|||
* 数据保存或提交 0 保存 1提交 |
|||
*/ |
|||
@ExcelProperty(value = "数据保存或提交 0 保存 1提交") |
|||
private Long hasSubmit; |
|||
|
|||
/** |
|||
* 是否评价 0 否 1 是 |
|||
*/ |
|||
@ExcelProperty(value = "是否评价 0 否 1 是") |
|||
private Long hasEvaluate; |
|||
|
|||
/** |
|||
* 预告id |
|||
*/ |
|||
@ExcelProperty(value = "预告id") |
|||
private String lawId; |
|||
|
|||
/** |
|||
* 预告 |
|||
*/ |
|||
@ExcelProperty(value = "预告") |
|||
private String lawText; |
|||
|
|||
/** |
|||
* 执法主体部门id |
|||
*/ |
|||
@ExcelProperty(value = "执法主体部门id") |
|||
private String bureauDeptId; |
|||
|
|||
/** |
|||
* 执法主体 |
|||
*/ |
|||
@ExcelProperty(value = "执法主体") |
|||
private String bureauDeptName; |
|||
|
|||
/** |
|||
* 执法主体部门统一信用代码 |
|||
*/ |
|||
@ExcelProperty(value = "执法主体部门统一信用代码") |
|||
private String creditcode; |
|||
|
|||
/** |
|||
* 用户id |
|||
*/ |
|||
@ExcelProperty(value = "用户id") |
|||
private String userId; |
|||
|
|||
/** |
|||
* 部门ID |
|||
*/ |
|||
@ExcelProperty(value = "部门ID") |
|||
private String deptId; |
|||
|
|||
/** |
|||
* 企业注册地址 |
|||
*/ |
|||
@ExcelProperty(value = "企业注册地址") |
|||
private String enterpriseAddress; |
|||
|
|||
/** |
|||
* 企业注册区 |
|||
*/ |
|||
@ExcelProperty(value = "企业注册区") |
|||
private String district; |
|||
|
|||
/** |
|||
* 企业注册街道 |
|||
*/ |
|||
@ExcelProperty(value = "企业注册街道") |
|||
private String street; |
|||
|
|||
/** |
|||
* 未扫码原因 |
|||
*/ |
|||
@ExcelProperty(value = "未扫码原因") |
|||
private String reason; |
|||
|
|||
/** |
|||
* 其他执法者列表 |
|||
*/ |
|||
private List<String> lawEnforcerOtherList; |
|||
|
|||
/**数据权限参数 */ |
|||
private Map<String, Object> params; |
|||
|
|||
/** |
|||
* 区域 |
|||
*/ |
|||
private String area; |
|||
|
|||
} |
|||
@ -0,0 +1,70 @@ |
|||
package com.zdxt.enforcementcode.mapper; |
|||
|
|||
import com.zdxt.enforcementcode.domain.bo.NonEnforcementRegistrationBo; |
|||
import com.zdxt.enforcementcode.domain.vo.NonEnforcementRegistrationVo; |
|||
import org.springframework.stereotype.Repository; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 非行政执法登记Mapper接口 |
|||
* |
|||
* @author kylin |
|||
* @date 2025-06-19 |
|||
*/ |
|||
@Repository |
|||
public interface NonEnforcementRegistrationMapper |
|||
{ |
|||
/** |
|||
* 查询非行政执法登记 |
|||
* |
|||
* @param id 非行政执法登记ID |
|||
* @return 非行政执法登记 |
|||
*/ |
|||
public NonEnforcementRegistrationVo selectNonEnforcementRegistrationById(String id); |
|||
|
|||
/** |
|||
* 查询非行政执法登记列表 |
|||
* |
|||
* @param bo 非行政执法登记 |
|||
* @return 非行政执法登记集合 |
|||
*/ |
|||
public List<NonEnforcementRegistrationVo> selectNonEnforcementRegistrationList(NonEnforcementRegistrationBo bo); |
|||
|
|||
/** |
|||
* 新增非行政执法登记 |
|||
* |
|||
* @param bo 非行政执法登记 |
|||
* @return 结果 |
|||
*/ |
|||
public int insertNonEnforcementRegistration(NonEnforcementRegistrationBo bo); |
|||
|
|||
/** |
|||
* 修改非行政执法登记 |
|||
* |
|||
* @param bo 非行政执法登记 |
|||
* @return 结果 |
|||
*/ |
|||
public int updateNonEnforcementRegistration(NonEnforcementRegistrationBo bo); |
|||
|
|||
/** |
|||
* 删除非行政执法登记 |
|||
* |
|||
* @param id 非行政执法登记ID |
|||
* @return 结果 |
|||
*/ |
|||
public int deleteNonEnforcementRegistrationById(String id); |
|||
|
|||
/** |
|||
* 批量删除非行政执法登记 |
|||
* |
|||
* @param ids 需要删除的数据ID |
|||
* @return 结果 |
|||
*/ |
|||
public int deleteNonEnforcementRegistrationByIds(String[] ids); |
|||
|
|||
|
|||
List<NonEnforcementRegistrationVo> getList(NonEnforcementRegistrationBo bo); |
|||
|
|||
int getListTotal(NonEnforcementRegistrationBo bo); |
|||
} |
|||
@ -0,0 +1,71 @@ |
|||
package com.zdxt.enforcementcode.service; |
|||
|
|||
import com.zdxt.enforcementcode.domain.bo.NonEnforcementRegistrationBo; |
|||
import com.zdxt.enforcementcode.domain.vo.NonEnforcementRegistrationVo; |
|||
import jakarta.servlet.http.HttpServletResponse; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 非行政执法登记Service接口 |
|||
* |
|||
* @author kylin |
|||
* @date 2025-06-19 |
|||
*/ |
|||
public interface INonEnforcementRegistrationService |
|||
{ |
|||
/** |
|||
* 查询非行政执法登记 |
|||
* |
|||
* @param id 非行政执法登记ID |
|||
* @return 非行政执法登记 |
|||
*/ |
|||
public NonEnforcementRegistrationVo selectNonEnforcementRegistrationById(String id); |
|||
|
|||
/** |
|||
* 查询非行政执法登记列表 |
|||
* |
|||
* @param bo 非行政执法登记 |
|||
* @return 非行政执法登记集合 |
|||
*/ |
|||
public List<NonEnforcementRegistrationVo> selectNonEnforcementRegistrationList(NonEnforcementRegistrationBo bo); |
|||
|
|||
/** |
|||
* 新增非行政执法登记 |
|||
* |
|||
* @param bo 非行政执法登记 |
|||
* @return 结果 |
|||
*/ |
|||
public int insertNonEnforcementRegistration(NonEnforcementRegistrationBo bo); |
|||
|
|||
/** |
|||
* 修改非行政执法登记 |
|||
* |
|||
* @param bo 非行政执法登记 |
|||
* @return 结果 |
|||
*/ |
|||
public int updateNonEnforcementRegistration(NonEnforcementRegistrationBo bo); |
|||
|
|||
/** |
|||
* 批量删除非行政执法登记 |
|||
* |
|||
* @param ids 需要删除的数据ID |
|||
* @return 结果 |
|||
*/ |
|||
public int deleteNonEnforcementRegistrationByIds(String ids); |
|||
|
|||
/** |
|||
* 删除非行政执法登记信息 |
|||
* |
|||
* @param id 非行政执法登记ID |
|||
* @return 结果 |
|||
*/ |
|||
public int deleteNonEnforcementRegistrationById(String id); |
|||
|
|||
|
|||
List<NonEnforcementRegistrationVo> getList(NonEnforcementRegistrationBo bo); |
|||
|
|||
void downloadExcel(HttpServletResponse response, NonEnforcementRegistrationBo bo); |
|||
|
|||
int getListTotal(NonEnforcementRegistrationBo bo); |
|||
} |
|||
@ -0,0 +1,334 @@ |
|||
package com.zdxt.enforcementcode.service.impl; |
|||
|
|||
import cn.hutool.core.convert.Convert; |
|||
import cn.hutool.core.util.IdUtil; |
|||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|||
import com.zdxt.enforcementcode.common.annotation.DataScope; |
|||
import com.zdxt.enforcementcode.common.util.CommonUtil; |
|||
import com.zdxt.enforcementcode.domain.ZdxtFile; |
|||
import com.zdxt.enforcementcode.domain.bo.NonEnforcementRegistrationBo; |
|||
import com.zdxt.enforcementcode.domain.vo.NonEnforcementRegistrationVo; |
|||
import com.zdxt.enforcementcode.mapper.NonEnforcementRegistrationMapper; |
|||
import com.zdxt.enforcementcode.mapper.ZdxtFileMapper; |
|||
import com.zdxt.enforcementcode.service.INonEnforcementRegistrationService; |
|||
import jakarta.servlet.ServletOutputStream; |
|||
import jakarta.servlet.http.HttpServletResponse; |
|||
import org.apache.poi.hssf.usermodel.*; |
|||
import org.apache.poi.ss.usermodel.*; |
|||
import org.dromara.common.core.enums.FormatsType; |
|||
import org.dromara.common.core.exception.ServiceException; |
|||
import org.dromara.common.core.utils.DateUtils; |
|||
import org.dromara.common.core.utils.StringUtils; |
|||
import org.dromara.common.satoken.utils.LoginHelper; |
|||
import org.dromara.system.domain.vo.SysDictDataVo; |
|||
import org.dromara.system.domain.vo.SysUserVo; |
|||
import org.dromara.system.mapper.SysDictDataMapper; |
|||
import org.dromara.system.mapper.SysUserMapper; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
import java.net.URLEncoder; |
|||
import java.util.ArrayList; |
|||
import java.util.HashMap; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
import java.util.stream.Collectors; |
|||
|
|||
/** |
|||
* 非行政执法登记Service业务层处理 |
|||
* |
|||
* @author kylin |
|||
* @date 2025-06-19 |
|||
*/ |
|||
@Service |
|||
public class NonEnforcementRegistrationServiceImpl implements INonEnforcementRegistrationService |
|||
{ |
|||
@Autowired private NonEnforcementRegistrationMapper nonEnforcementRegistrationMapper; |
|||
@Autowired private ZdxtFileMapper zdxtFileMapper; |
|||
@Autowired private SysUserMapper sysUserMapper; |
|||
@Autowired private SysDictDataMapper sysDictDataMapper; |
|||
|
|||
|
|||
/** |
|||
* 查询非行政执法登记 |
|||
* |
|||
* @param id 非行政执法登记ID |
|||
* @return 非行政执法登记 |
|||
*/ |
|||
@Override |
|||
public NonEnforcementRegistrationVo selectNonEnforcementRegistrationById(String id) |
|||
{ |
|||
NonEnforcementRegistrationVo nonReg = nonEnforcementRegistrationMapper.selectNonEnforcementRegistrationById(id); |
|||
if (nonReg.getId() != null) { |
|||
SysUserVo user = sysUserMapper.selectUserById(Long.valueOf(nonReg.getLawEnforcerId())); |
|||
String temp=user.getLawCertificateNum(); |
|||
if(StringUtils.isEmpty(temp)){ |
|||
temp= CommonUtil.encryptPhone(user.getPhonenumber()); |
|||
} |
|||
nonReg.setLawEnforcer(user.getUserName()+" "+temp); |
|||
if(StringUtils.isNotEmpty(nonReg.getLawEnforcerOther())){ |
|||
List<SysUserVo> list = sysUserMapper.selectUserByIds(Convert.toStrArray(nonReg.getLawEnforcerIdOther())); |
|||
if(list.size()!=0){ |
|||
String tmpUserShow = ""; |
|||
for (SysUserVo ub : list) { |
|||
String t = ub.getLawCertificateNum(); |
|||
if(StringUtils.isEmpty(t)){ |
|||
t=CommonUtil.encryptPhone(ub.getPhonenumber()); |
|||
} |
|||
tmpUserShow += ub.getUserName() +" "+ t + ","; |
|||
} |
|||
if (tmpUserShow.length() > 0) { |
|||
tmpUserShow = tmpUserShow.substring(0, tmpUserShow.length()-1); |
|||
} |
|||
nonReg.setLawEnforcerOther(tmpUserShow); |
|||
} |
|||
} |
|||
|
|||
LambdaQueryWrapper<ZdxtFile> queryWrapper = new LambdaQueryWrapper<>(); |
|||
queryWrapper.eq(ZdxtFile::getBusinessId, nonReg.getId()); |
|||
List<ZdxtFile> zdxtFileCommons=zdxtFileMapper.selectList(queryWrapper); |
|||
if (zdxtFileCommons.size() > 0) { |
|||
Map<String, Object> params = new HashMap<String, Object>(); |
|||
params.put("fileList", zdxtFileCommons); |
|||
nonReg.setParams(params); |
|||
} |
|||
} |
|||
return nonReg; |
|||
} |
|||
|
|||
/** |
|||
* 查询非行政执法登记列表 |
|||
* |
|||
* @param bo 非行政执法登记 |
|||
* @return 非行政执法登记 |
|||
*/ |
|||
@Override |
|||
public List<NonEnforcementRegistrationVo> selectNonEnforcementRegistrationList(NonEnforcementRegistrationBo bo) |
|||
{ |
|||
List<NonEnforcementRegistrationVo> list=nonEnforcementRegistrationMapper.selectNonEnforcementRegistrationList(bo); |
|||
if(list.size()!=0){ |
|||
// 执法人员 没有执法证件号展示加密手机号
|
|||
list.forEach(li->{ |
|||
if (StringUtils.isNotEmpty(li.getLawEnforcerId())) { |
|||
SysUserVo sysUserVo = sysUserMapper.selectUserById(Long.valueOf(li.getLawEnforcerId())); |
|||
if (sysUserVo != null) { |
|||
String lawCN = sysUserVo.getLawCertificateNum(); |
|||
if(StringUtils.isEmpty(lawCN)){ |
|||
lawCN = CommonUtil.encryptPhone(sysUserVo.getPhonenumber()); |
|||
} |
|||
li.setLawEnforcer(sysUserVo.getUserName() + " " + lawCN); |
|||
} else { |
|||
li.setLawEnforcer(li.getLawEnforcer()); |
|||
} |
|||
} |
|||
|
|||
List<String> lawTwoList = new ArrayList<>(); |
|||
if (StringUtils.isNotEmpty(li.getLawEnforcerOther()) && StringUtils.isNotEmpty(li.getLawEnforcerIdOther())) { |
|||
List<SysUserVo> userBeans = sysUserMapper.selectUserByIds(Convert.toStrArray(li.getLawEnforcerIdOther())); |
|||
if (userBeans != null && !userBeans.isEmpty()) { |
|||
userBeans.forEach(u->{ |
|||
if (u != null) { |
|||
String temp = u.getLawCertificateNum(); |
|||
if(StringUtils.isEmpty(temp)){ |
|||
temp = CommonUtil.encryptPhone(u.getPhonenumber()); |
|||
} |
|||
lawTwoList.add(u.getUserName() + " " + temp); |
|||
} |
|||
}); |
|||
li.setLawEnforcerOtherList(lawTwoList); |
|||
} |
|||
} |
|||
}); |
|||
} |
|||
return list; |
|||
} |
|||
|
|||
/** |
|||
* 新增非行政执法登记 |
|||
* |
|||
* @param bo 非行政执法登记 |
|||
* @return 结果 |
|||
*/ |
|||
@Override |
|||
public int insertNonEnforcementRegistration(NonEnforcementRegistrationBo bo) |
|||
{ |
|||
bo.setId(IdUtil.simpleUUID()); |
|||
Long userId = LoginHelper.getUserId(); |
|||
String deptId = LoginHelper.getDeptId(); |
|||
|
|||
if (userId == null) { |
|||
throw new ServiceException("用户未登录,无法创建记录"); |
|||
} |
|||
String district = extract(bo.getEnterpriseAddress(), "([^\\s市]+?区)"); |
|||
String street = extract(bo.getEnterpriseAddress(), "([^\\s区]+?街道)"); |
|||
bo.setDistrict(district); |
|||
bo.setStreet(street); |
|||
bo.setCreateBy(userId); |
|||
bo.setCreateTime(DateUtils.getNowDate()); |
|||
bo.setUserId(Convert.toStr(userId)); |
|||
bo.setDeptId(deptId); |
|||
int resNum = nonEnforcementRegistrationMapper.insertNonEnforcementRegistration(bo); |
|||
|
|||
// 重新加入附件
|
|||
if (resNum > 0 && bo.getFileList() != null && bo.getFileList().size() > 0) { |
|||
zdxtFileMapper.deleteZdxtFileByBusinessIds(Convert.toStrArray(bo.getId())); |
|||
bo.getFileList().forEach(res -> { |
|||
ZdxtFile zdxtFile = new ZdxtFile(); |
|||
zdxtFile.setBusinessId(bo.getId()); |
|||
zdxtFile.setGuid(IdUtil.simpleUUID()); |
|||
zdxtFile.setUploadPath(res); |
|||
zdxtFile.setUploadPersonId(Convert.toStr(LoginHelper.getUserId())); |
|||
zdxtFile.setUploadPersonName(LoginHelper.getUsername()); |
|||
zdxtFileMapper.insertZdxtFile(zdxtFile); |
|||
}); |
|||
} |
|||
return resNum; |
|||
} |
|||
|
|||
private static String extract(String text, String regex) { |
|||
java.util.regex.Pattern pattern = java.util.regex.Pattern.compile(regex); |
|||
java.util.regex.Matcher matcher = pattern.matcher(text); |
|||
if (matcher.find()) { |
|||
return matcher.group(1); |
|||
} |
|||
return ""; |
|||
} |
|||
/** |
|||
* 修改非行政执法登记 |
|||
* |
|||
* @param bo 非行政执法登记 |
|||
* @return 结果 |
|||
*/ |
|||
@Override |
|||
public int updateNonEnforcementRegistration(NonEnforcementRegistrationBo bo) |
|||
{ |
|||
return nonEnforcementRegistrationMapper.updateNonEnforcementRegistration(bo); |
|||
} |
|||
|
|||
/** |
|||
* 删除非行政执法登记对象 |
|||
* |
|||
* @param ids 需要删除的数据ID |
|||
* @return 结果 |
|||
*/ |
|||
@Override |
|||
public int deleteNonEnforcementRegistrationByIds(String ids) |
|||
{ |
|||
return nonEnforcementRegistrationMapper.deleteNonEnforcementRegistrationByIds(Convert.toStrArray(ids)); |
|||
} |
|||
|
|||
/** |
|||
* 删除非行政执法登记信息 |
|||
* |
|||
* @param id 非行政执法登记ID |
|||
* @return 结果 |
|||
*/ |
|||
@Override |
|||
public int deleteNonEnforcementRegistrationById(String id) |
|||
{ |
|||
return nonEnforcementRegistrationMapper.deleteNonEnforcementRegistrationById(id); |
|||
} |
|||
|
|||
@Override |
|||
@DataScope(deptAlias = "n",userAlias = "n",deptField = "bureau_dept_id") |
|||
public List<NonEnforcementRegistrationVo> getList(NonEnforcementRegistrationBo param) { |
|||
List<NonEnforcementRegistrationVo> list=nonEnforcementRegistrationMapper.getList(param); |
|||
if(list.size()==0)return list; |
|||
List<SysDictDataVo> areaList=sysDictDataMapper.selectDictDataByType("address_Type"); |
|||
List<String> areaType=areaList.stream().map(li->li.getDictValue()).collect(Collectors.toList()); |
|||
List<SysDictDataVo> streetList=sysDictDataMapper.selectDataByDataTypes(areaType); |
|||
list.forEach(li->{ |
|||
if(StringUtils.isNotEmpty(li.getLawEnforcerOther())){ |
|||
li.setLawEnforcer(li.getLawEnforcer()+","+li.getLawEnforcerOther()); |
|||
} |
|||
if(StringUtils.isNotEmpty(li.getEnterpriseAddress())){ |
|||
SysDictDataVo area=areaList.stream().filter(a->li.getEnterpriseAddress().contains(a.getDictLabel())).findFirst().orElse(null); |
|||
li.setArea(area!=null?area.getDictLabel():""); |
|||
SysDictDataVo street=streetList.stream().filter(s->li.getEnterpriseAddress().contains(s.getDictLabel())).findFirst().orElse(null); |
|||
li.setStreet(street!=null?street.getDictLabel():""); |
|||
} |
|||
}); |
|||
return list; |
|||
} |
|||
|
|||
@Override |
|||
public void downloadExcel(HttpServletResponse response, NonEnforcementRegistrationBo param){ |
|||
try{ |
|||
String fileName =URLEncoder.encode("非行政检查统计.xls", "UTF-8"); |
|||
HSSFWorkbook workbook = new HSSFWorkbook(); |
|||
HSSFSheet sheet = workbook.createSheet("非行政检查统计"); |
|||
sheet.setDefaultColumnWidth(20);//全局
|
|||
HSSFFont font2=workbook.createFont(); |
|||
font2.setFontName("微软雅黑"); |
|||
font2.setBold(true); |
|||
font2.setFontHeightInPoints((short) 11); |
|||
HSSFCellStyle styleRow2=workbook.createCellStyle(); |
|||
styleRow2.setWrapText(true);//换行
|
|||
styleRow2.setFillForegroundColor(IndexedColors.GREY_25_PERCENT.getIndex()); |
|||
styleRow2.setFillPattern(FillPatternType.SOLID_FOREGROUND); |
|||
styleRow2.setAlignment(HorizontalAlignment.CENTER); |
|||
styleRow2.setVerticalAlignment(VerticalAlignment.CENTER); |
|||
styleRow2.setBorderTop(BorderStyle.THIN); |
|||
styleRow2.setBorderRight(BorderStyle.THIN); |
|||
styleRow2.setBorderBottom(BorderStyle.THIN); |
|||
styleRow2.setBorderLeft(BorderStyle.THIN); |
|||
styleRow2.setFont(font2); |
|||
HSSFRow headerRow = sheet.createRow(0); |
|||
// String[] header = {"被执法企业名称","企业所属区域", "企业所属街道", "执法单位", "执法人员","执法时间","入企事由","入企事项","活动依据"};
|
|||
String[] header = {"单位名称", "企业名称","统一信用码","企业注册地", "企业所属街道", "入企人员","入企时间","入企事由","入企事项","活动依据"}; |
|||
for (int i = 0; i < header.length; i++) { |
|||
HSSFCell cell = headerRow.createCell(i); |
|||
HSSFRichTextString text = new HSSFRichTextString(header[i]); |
|||
cell.setCellValue(text); |
|||
cell.setCellStyle(styleRow2); |
|||
} |
|||
HSSFCellStyle dateStyle= workbook.createCellStyle(); |
|||
HSSFDataFormat cellDataFormat= workbook.createDataFormat(); |
|||
dateStyle.setDataFormat(cellDataFormat.getFormat("yyyy\"年\"m\"月\"d\"日\" h:mm:ss")); |
|||
|
|||
setExcel(sheet,param); |
|||
//先将workbook写入字节数组,获取长度后再写入响应流,防止大文件导出时管道断开
|
|||
java.io.ByteArrayOutputStream bos = new java.io.ByteArrayOutputStream(); |
|||
workbook.write(bos); |
|||
workbook.close(); |
|||
byte[] content = bos.toByteArray(); |
|||
response.setCharacterEncoding("UTF-8"); |
|||
response.setContentType("application/vnd.ms-excel"); |
|||
response.setHeader("Content-disposition", "attachment;filename=" + fileName); |
|||
response.setContentLength(content.length); |
|||
response.setHeader("Connection", "keep-alive"); |
|||
ServletOutputStream outputStream = response.getOutputStream(); |
|||
outputStream.write(content); |
|||
outputStream.flush(); |
|||
outputStream.close(); |
|||
}catch (Exception e){ |
|||
e.printStackTrace(); |
|||
} |
|||
|
|||
} |
|||
|
|||
// 设置excel
|
|||
private void setExcel(HSSFSheet sheet,NonEnforcementRegistrationBo param) throws Exception{ |
|||
List<NonEnforcementRegistrationVo> list=getList(param); |
|||
if(list.size()==0)return; |
|||
final int[] i = {1}; |
|||
list.forEach(li->{ |
|||
HSSFRow row = sheet.createRow(i[0]); |
|||
row.createCell(0).setCellValue(li.getBureauDeptName()); |
|||
row.createCell(1).setCellValue(li.getEnterpriseName()); |
|||
row.createCell(2).setCellValue(li.getEnterpriseNumber()); |
|||
row.createCell(3).setCellValue(li.getArea()); |
|||
row.createCell(4).setCellValue(li.getStreet()); |
|||
row.createCell(5).setCellValue(li.getLawEnforcer()); |
|||
row.createCell(6).setCellValue(DateUtils.parseDateToStr(FormatsType.YYYY_MM_DD_HH_MM_SS, li.getEnforcementTime())); |
|||
row.createCell(7).setCellValue(li.getLawEnforcementTypeText()); |
|||
row.createCell(8).setCellValue(li.getLawEnforcementItemText()); |
|||
row.createCell(9).setCellValue(li.getLawEnforcementBasisText()); |
|||
i[0]++; |
|||
}); |
|||
} |
|||
|
|||
@Override |
|||
public int getListTotal(NonEnforcementRegistrationBo param) { |
|||
return nonEnforcementRegistrationMapper.getListTotal(param); |
|||
} |
|||
} |
|||
@ -0,0 +1,431 @@ |
|||
<?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.NonEnforcementRegistrationMapper"> |
|||
|
|||
<resultMap type="com.zdxt.enforcementcode.domain.NonEnforcementRegistration" id="NonEnforcementRegistrationResult"> |
|||
<result property="id" column="id" /> |
|||
<result property="enterpriseName" column="enterprise_name" /> |
|||
<result property="enterpriseNumber" column="enterprise_number" /> |
|||
<result property="enforcementTime" column="enforcement_time" /> |
|||
<result property="lawEnforcer" column="law_enforcer" /> |
|||
<result property="lawEnforcerId" column="law_enforcer_id" /> |
|||
<result property="lawEnforcerOther" column="law_enforcer_other" /> |
|||
<result property="lawEnforcerIdOther" column="law_enforcer_id_other" /> |
|||
<result property="lawEnforcementType" column="law_enforcement_type" /> |
|||
<result property="lawEnforcementTypeText" column="law_enforcement_type_text" /> |
|||
<result property="lawEnforcementItem" column="law_enforcement_item" /> |
|||
<result property="lawEnforcementItemText" column="law_enforcement_item_text" /> |
|||
<result property="lawEnforcementBasis" column="law_enforcement_basis" /> |
|||
<result property="lawEnforcementBasisText" column="law_enforcement_basis_text" /> |
|||
<result property="remark" column="remark" /> |
|||
<result property="reason" column="reason" /> |
|||
<result property="reslut" column="reslut" /> |
|||
<result property="status" column="status" /> |
|||
<result property="hasDelete" column="has_delete" /> |
|||
<result property="hasComplaint" column="has_complaint" /> |
|||
<result property="hasSubmit" column="has_submit" /> |
|||
<result property="hasEvaluate" column="has_evaluate" /> |
|||
<result property="lawId" column="law_id" /> |
|||
<result property="lawText" column="law_text" /> |
|||
<result property="bureauDeptId" column="bureau_dept_id" /> |
|||
<result property="bureauDeptName" column="bureau_dept_name" /> |
|||
<result property="creditcode" column="creditcode" /> |
|||
<result property="userId" column="user_id" /> |
|||
<result property="deptId" column="dept_id" /> |
|||
<result property="createBy" column="create_by" /> |
|||
<result property="updateBy" column="update_by" /> |
|||
<result property="createTime" column="create_time" /> |
|||
<result property="updateTime" column="update_time" /> |
|||
<result property="enterpriseAddress" column="enterprise_address" /> |
|||
<result property="district" column="district" /> |
|||
<result property="street" column="street" /> |
|||
</resultMap> |
|||
|
|||
<sql id="selectNonEnforcementRegistrationVo"> |
|||
select |
|||
id, |
|||
enterprise_name, |
|||
enterprise_number, |
|||
enforcement_time, |
|||
law_enforcer, |
|||
law_enforcer_id, |
|||
law_enforcer_other, |
|||
law_enforcer_id_other, |
|||
law_enforcement_type, |
|||
law_enforcement_type_text, |
|||
law_enforcement_item, |
|||
law_enforcement_item_text, |
|||
law_enforcement_basis, |
|||
law_enforcement_basis_text, |
|||
remark, |
|||
reason, |
|||
reslut, |
|||
status, |
|||
has_delete, |
|||
has_complaint, |
|||
has_submit, |
|||
has_evaluate, |
|||
law_id, |
|||
law_text, |
|||
bureau_dept_id, |
|||
bureau_dept_name, |
|||
creditcode, |
|||
user_id, |
|||
dept_id, |
|||
create_by, |
|||
update_by, |
|||
create_time, |
|||
update_time, |
|||
enterprise_address, |
|||
district, |
|||
street |
|||
from |
|||
non_enforcement_registration |
|||
</sql> |
|||
|
|||
<select id="selectNonEnforcementRegistrationList" parameterType="com.zdxt.enforcementcode.domain.bo.NonEnforcementRegistrationBo" resultType="com.zdxt.enforcementcode.domain.vo.NonEnforcementRegistrationVo"> |
|||
<include refid="selectNonEnforcementRegistrationVo"/> |
|||
<where> |
|||
<if test="enterpriseName != null and enterpriseName != ''"> and enterprise_name like concat('%', #{enterpriseName}, '%')</if> |
|||
<if test="enterpriseNumber != null and enterpriseNumber != ''"> and enterprise_number = #{enterpriseNumber}</if> |
|||
<if test="enforcementTime != null "> and enforcement_time = #{enforcementTime}</if> |
|||
<if test="lawEnforcer != null and lawEnforcer != ''"> and law_enforcer = #{lawEnforcer}</if> |
|||
<if test="lawEnforcerId != null and lawEnforcerId != ''"> and law_enforcer_id = #{lawEnforcerId}</if> |
|||
<if test="lawEnforcerOther != null and lawEnforcerOther != ''"> and law_enforcer_other = #{lawEnforcerOther}</if> |
|||
<if test="lawEnforcerIdOther != null and lawEnforcerIdOther != ''"> and law_enforcer_id_other = #{lawEnforcerIdOther}</if> |
|||
<if test="lawEnforcementType != null "> and law_enforcement_type = #{lawEnforcementType}</if> |
|||
<if test="lawEnforcementTypeText != null and lawEnforcementTypeText != ''"> and law_enforcement_type_text = #{lawEnforcementTypeText}</if> |
|||
<if test="lawEnforcementItem != null "> and law_enforcement_item = #{lawEnforcementItem}</if> |
|||
<if test="lawEnforcementItemText != null and lawEnforcementItemText != ''"> and law_enforcement_item_text = #{lawEnforcementItemText}</if> |
|||
<if test="lawEnforcementBasis != null and lawEnforcementBasis != ''"> and law_enforcement_basis = #{lawEnforcementBasis}</if> |
|||
<if test="lawEnforcementBasisText != null and lawEnforcementBasisText != ''"> and law_enforcement_basis_text = #{lawEnforcementBasisText}</if> |
|||
<if test="reslut != null and reslut != ''"> and reslut = #{reslut}</if> |
|||
<if test="status != null and status != ''"> and status = #{status}</if> |
|||
<if test="hasDelete != null and hasDelete != ''"> and has_delete = #{hasDelete}</if> |
|||
<if test="hasComplaint != null and hasComplaint != ''"> and has_complaint = #{hasComplaint}</if> |
|||
<if test="hasSubmit != null and hasSubmit != ''"> and has_submit = #{hasSubmit}</if> |
|||
<if test="hasEvaluate != null and hasEvaluate != ''"> and has_evaluate = #{hasEvaluate}</if> |
|||
<if test="lawId != null and lawId != ''"> and law_id = #{lawId}</if> |
|||
<if test="lawText != null and lawText != ''"> and law_text = #{lawText}</if> |
|||
<if test="bureauDeptId != null and bureauDeptId != ''"> and bureau_dept_id = #{bureauDeptId}</if> |
|||
<if test="bureauDeptName != null and bureauDeptName != ''"> and bureau_dept_name like concat('%', #{bureauDeptName}, '%')</if> |
|||
<if test="creditcode != null and creditcode != ''"> and creditcode = #{creditcode}</if> |
|||
<if test="userId != null and userId != ''"> and user_id = #{userId}</if> |
|||
<if test="deptId != null and deptId != ''"> and dept_id = #{deptId}</if> |
|||
<if test="searchValue != null and searchValue != ''"> |
|||
and (law_enforcement_item_text like concat('%',#{searchValue},'%') |
|||
or bureau_dept_name like concat('%',#{searchValue},'%') |
|||
or law_enforcer like concat('%',#{searchValue},'%') |
|||
or law_enforcer_other like concat('%',#{searchValue},'%') |
|||
) |
|||
</if> |
|||
<if test="dateType != null and dateType == 1"> |
|||
and DATE_FORMAT(enforcement_time, '%Y-%m') = DATE_FORMAT(CURDATE(), '%Y-%m') |
|||
</if> |
|||
<if test="dateType != null and dateType == 2"> |
|||
AND DATE_FORMAT(enforcement_time, '%Y-%m') >= CONCAT(YEAR(CURDATE()), '-', |
|||
CASE WHEN QUARTER(CURDATE()) IN (1) THEN '01' |
|||
WHEN QUARTER(CURDATE()) IN (2) THEN '04' |
|||
WHEN QUARTER(CURDATE()) IN (3) THEN '07' |
|||
ELSE '10' END) |
|||
and DATE_FORMAT(enforcement_time, '%Y-%m') <= CONCAT(YEAR(CURDATE()), '-', |
|||
CASE |
|||
WHEN QUARTER(CURDATE()) IN (1) THEN '03' |
|||
WHEN QUARTER(CURDATE()) IN (2) THEN '06' |
|||
WHEN QUARTER(CURDATE()) IN (3) THEN '09' |
|||
ELSE '12' |
|||
END) |
|||
</if> |
|||
<if test="dateType != null and dateType == 3"> |
|||
and DATE_FORMAT(enforcement_time, '%Y') = DATE_FORMAT(CURDATE(), '%Y') |
|||
</if> |
|||
<if test="dateSearch != null and dateSearch != ''"> |
|||
and DATE_FORMAT(enforcement_time, '%Y-%m') = #{dateSearch} |
|||
</if> |
|||
</where> |
|||
order by enforcement_time desc |
|||
</select> |
|||
|
|||
<select id="selectNonEnforcementRegistrationById" parameterType="String" resultType="com.zdxt.enforcementcode.domain.vo.NonEnforcementRegistrationVo"> |
|||
<include refid="selectNonEnforcementRegistrationVo"/> |
|||
where id = #{id} |
|||
</select> |
|||
|
|||
<select id="getList" resultType="com.zdxt.enforcementcode.domain.vo.NonEnforcementRegistrationVo" parameterType="com.zdxt.enforcementcode.domain.bo.NonEnforcementRegistrationBo"> |
|||
SELECT |
|||
n.enterprise_name, |
|||
n.enterprise_number, |
|||
n.enforcement_time, |
|||
n.law_enforcer, |
|||
n.law_enforcer_other, |
|||
n.bureau_dept_name, |
|||
n.law_enforcement_type_text, |
|||
n.law_enforcement_item_text, |
|||
n.law_enforcement_basis_text, |
|||
n.enterprise_address, |
|||
n.district, |
|||
n.street |
|||
FROM |
|||
non_enforcement_registration n |
|||
<choose> |
|||
<when test="(street==null or street=='') and (area==null or area=='') "> |
|||
left join enterprise_information e on e.enterprise_number=n.enterprise_number |
|||
<if test="street!=null and street!=''"> |
|||
and e.enterprise_address like concat('%', #{streetText}, '%') |
|||
</if> |
|||
<if test="area!=null and area!=''"> |
|||
and e.enterprise_address like concat('%', #{areaText}, '%') |
|||
</if> |
|||
</when> |
|||
<otherwise> |
|||
inner join enterprise_information e on e.enterprise_number=n.enterprise_number |
|||
<if test="street!=null and street!=''"> |
|||
and e.enterprise_address like concat('%', #{streetText}, '%') |
|||
</if> |
|||
<if test="area!=null and area!=''"> |
|||
and e.enterprise_address like concat('%', #{areaText}, '%') |
|||
</if> |
|||
</otherwise> |
|||
</choose> |
|||
where n.has_delete= 0 |
|||
<if test="enterpriseAddress != null and enterpriseAddress != ''"> |
|||
and n.enterprise_address like concat('%', #{enterpriseAddress}, '%') |
|||
</if> |
|||
<if test="bureauDeptName != null and bureauDeptName != ''"> |
|||
and n.bureau_dept_name like concat('%', #{bureauDeptName}, '%') |
|||
</if> |
|||
<if test="lawEnforcer != null and lawEnforcer != ''"> |
|||
and ( n.law_enforcer like concat('%', #{lawEnforcer}, '%') |
|||
or |
|||
n.law_enforcer_other like concat('%', #{lawEnforcer}, '%') |
|||
) |
|||
</if> |
|||
<if test="lawEnforcementItemText != null and lawEnforcementItemText != ''"> |
|||
and n.law_enforcement_item_text like concat('%', #{lawEnforcementItemText}, '%') |
|||
</if> |
|||
<if test="enterpriseName != null and enterpriseName != ''"> |
|||
and n.enterprise_name like concat('%', #{enterpriseName}, '%') |
|||
</if> |
|||
<if test="lawEnforcementType !=null"> |
|||
and n.law_enforcement_type =#{lawEnforcementType} |
|||
</if> |
|||
|
|||
<if test="dateSearch == 'year' and year != null and year != ''"> |
|||
AND YEAR(n.enforcement_time) = #{year} |
|||
</if> |
|||
<if test="dateSearch == 'quarter' and quarter != null and quarter != '' "> |
|||
AND QUARTER(n.enforcement_time) = #{quarter} |
|||
</if> |
|||
<if test="dateSearch == 'month' and month != null and month != '' "> |
|||
AND MONTH(n.enforcement_time) = #{month} |
|||
</if> |
|||
<if test="dateSearch == 'selectTime' and startTime != null and startTime != '' "> |
|||
and DATE_FORMAT(n.enforcement_time,'%Y-%m-%d') >= STR_TO_DATE(#{startTime},'%Y-%m-%d') |
|||
</if> |
|||
<if test="dateSearch == 'selectTime' and endTime != null and endTime != '' "> |
|||
and DATE_FORMAT(n.enforcement_time,'%Y-%m-%d') <![CDATA[<=]]> STR_TO_DATE(#{endTime},'%Y-%m-%d') |
|||
</if> |
|||
<!-- 数据范围过滤 --> |
|||
<if test="params.dataScope != null and params.dataScope != ''"> |
|||
<!-- 数据范围过滤 --> |
|||
${params.dataScope} |
|||
</if> |
|||
order by n.enforcement_time desc |
|||
</select> |
|||
|
|||
<insert id="insertNonEnforcementRegistration" parameterType="com.zdxt.enforcementcode.domain.bo.NonEnforcementRegistrationBo"> |
|||
insert into non_enforcement_registration |
|||
<trim prefix="(" suffix=")" suffixOverrides=","> |
|||
<if test="id != null and id != ''">id,</if> |
|||
<if test="enterpriseName != null and enterpriseName != ''">enterprise_name,</if> |
|||
<if test="enterpriseNumber != null and enterpriseNumber != ''">enterprise_number,</if> |
|||
<if test="enterpriseAddress != null and enterpriseAddress != ''">enterprise_address,</if> |
|||
<if test="district != null and district != ''">district,</if> |
|||
<if test="street != null and street != ''">street,</if> |
|||
<if test="enforcementTime != null ">enforcement_time,</if> |
|||
<if test="lawEnforcer != null and lawEnforcer != ''">law_enforcer,</if> |
|||
<if test="lawEnforcerId != null and lawEnforcerId != ''">law_enforcer_id,</if> |
|||
<if test="lawEnforcerOther != null and lawEnforcerOther != ''">law_enforcer_other,</if> |
|||
<if test="lawEnforcerIdOther != null and lawEnforcerIdOther != ''">law_enforcer_id_other,</if> |
|||
<if test="lawEnforcementType != null ">law_enforcement_type,</if> |
|||
<if test="lawEnforcementTypeText != null and lawEnforcementTypeText != ''">law_enforcement_type_text,</if> |
|||
<if test="lawEnforcementItem != null ">law_enforcement_item,</if> |
|||
<if test="lawEnforcementItemText != null and lawEnforcementItemText != ''">law_enforcement_item_text,</if> |
|||
<if test="lawEnforcementBasis != null and lawEnforcementBasis != ''">law_enforcement_basis,</if> |
|||
<if test="lawEnforcementBasisText != null and lawEnforcementBasisText != ''">law_enforcement_basis_text,</if> |
|||
<if test="remark != null and remark != ''">remark,</if> |
|||
<if test="reason != null and reason != ''">reason,</if> |
|||
<if test="reslut != null ">reslut,</if> |
|||
<if test="status != null ">status,</if> |
|||
<if test="hasDelete != null ">has_delete,</if> |
|||
<if test="hasComplaint != null ">has_complaint,</if> |
|||
<if test="hasSubmit != null ">has_submit,</if> |
|||
<if test="hasEvaluate != null ">has_evaluate,</if> |
|||
<if test="lawId != null and lawId != ''">law_id,</if> |
|||
<if test="lawText != null and lawText != ''">law_text,</if> |
|||
<if test="bureauDeptId != null and bureauDeptId != ''">bureau_dept_id,</if> |
|||
<if test="bureauDeptName != null and bureauDeptName != ''">bureau_dept_name,</if> |
|||
<if test="creditcode != null and creditcode != ''">creditcode,</if> |
|||
<if test="userId != null and userId != ''">user_id,</if> |
|||
<if test="deptId != null and deptId != ''">dept_id,</if> |
|||
<if test="createBy != null and createBy != ''">create_by,</if> |
|||
<if test="updateBy != null and updateBy != ''">update_by,</if> |
|||
<if test="createTime != null ">create_time,</if> |
|||
<if test="updateTime != null ">update_time,</if> |
|||
</trim> |
|||
<trim prefix="values (" suffix=")" suffixOverrides=","> |
|||
<if test="id != null and id != ''">#{id},</if> |
|||
<if test="enterpriseName != null and enterpriseName != ''">#{enterpriseName},</if> |
|||
<if test="enterpriseNumber != null and enterpriseNumber != ''">#{enterpriseNumber},</if> |
|||
<if test="enterpriseAddress != null and enterpriseAddress != ''">#{enterpriseAddress},</if> |
|||
<if test="district != null and district != ''">#{district},</if> |
|||
<if test="street != null and street != ''">#{street},</if> |
|||
<if test="enforcementTime != null ">#{enforcementTime},</if> |
|||
<if test="lawEnforcer != null and lawEnforcer != ''">#{lawEnforcer},</if> |
|||
<if test="lawEnforcerId != null and lawEnforcerId != ''">#{lawEnforcerId},</if> |
|||
<if test="lawEnforcerOther != null and lawEnforcerOther != ''">#{lawEnforcerOther},</if> |
|||
<if test="lawEnforcerIdOther != null and lawEnforcerIdOther != ''">#{lawEnforcerIdOther},</if> |
|||
<if test="lawEnforcementType != null ">#{lawEnforcementType},</if> |
|||
<if test="lawEnforcementTypeText != null and lawEnforcementTypeText != ''">#{lawEnforcementTypeText},</if> |
|||
<if test="lawEnforcementItem != null ">#{lawEnforcementItem},</if> |
|||
<if test="lawEnforcementItemText != null and lawEnforcementItemText != ''">#{lawEnforcementItemText},</if> |
|||
<if test="lawEnforcementBasis != null and lawEnforcementBasis != ''">#{lawEnforcementBasis},</if> |
|||
<if test="lawEnforcementBasisText != null and lawEnforcementBasisText != ''">#{lawEnforcementBasisText},</if> |
|||
<if test="remark != null and remark != ''">#{remark},</if> |
|||
<if test="reason != null and reason != ''">#{reason},</if> |
|||
<if test="reslut != null ">#{reslut},</if> |
|||
<if test="status != null ">#{status},</if> |
|||
<if test="hasDelete != null ">#{hasDelete},</if> |
|||
<if test="hasComplaint != null ">#{hasComplaint},</if> |
|||
<if test="hasSubmit != null ">#{hasSubmit},</if> |
|||
<if test="hasEvaluate != null ">#{hasEvaluate},</if> |
|||
<if test="lawId != null and lawId != ''">#{lawId},</if> |
|||
<if test="lawText != null and lawText != ''">#{lawText},</if> |
|||
<if test="bureauDeptId != null and bureauDeptId != ''">#{bureauDeptId},</if> |
|||
<if test="bureauDeptName != null and bureauDeptName != ''">#{bureauDeptName},</if> |
|||
<if test="creditcode != null and creditcode != ''">#{creditcode},</if> |
|||
<if test="userId != null and userId != ''">#{userId},</if> |
|||
<if test="deptId != null and deptId != ''">#{deptId},</if> |
|||
<if test="createBy != null and createBy != ''">#{createBy},</if> |
|||
<if test="updateBy != null and updateBy != ''">#{updateBy},</if> |
|||
<if test="createTime != null ">#{createTime},</if> |
|||
<if test="updateTime != null ">#{updateTime},</if> |
|||
</trim> |
|||
</insert> |
|||
|
|||
<update id="updateNonEnforcementRegistration" parameterType="com.zdxt.enforcementcode.domain.bo.NonEnforcementRegistrationBo"> |
|||
update non_enforcement_registration |
|||
<trim prefix="SET" suffixOverrides=","> |
|||
<if test="enterpriseName != null and enterpriseName != ''">enterprise_name = #{enterpriseName},</if> |
|||
<if test="enterpriseNumber != null and enterpriseNumber != ''">enterprise_number = #{enterpriseNumber},</if> |
|||
<if test="enforcementTime != null ">enforcement_time = #{enforcementTime},</if> |
|||
<if test="lawEnforcer != null and lawEnforcer != ''">law_enforcer = #{lawEnforcer},</if> |
|||
<if test="lawEnforcerId != null and lawEnforcerId != ''">law_enforcer_id = #{lawEnforcerId},</if> |
|||
<if test="lawEnforcerOther != null and lawEnforcerOther != ''">law_enforcer_other = #{lawEnforcerOther},</if> |
|||
<if test="lawEnforcerIdOther != null and lawEnforcerIdOther != ''">law_enforcer_id_other = #{lawEnforcerIdOther},</if> |
|||
<if test="lawEnforcementType != null ">law_enforcement_type = #{lawEnforcementType},</if> |
|||
<if test="lawEnforcementTypeText != null and lawEnforcementTypeText != ''">law_enforcement_type_text = #{lawEnforcementTypeText},</if> |
|||
<if test="lawEnforcementItem != null ">law_enforcement_item = #{lawEnforcementItem},</if> |
|||
<if test="lawEnforcementItemText != null and lawEnforcementItemText != ''">law_enforcement_item_text = #{lawEnforcementItemText},</if> |
|||
<if test="lawEnforcementBasis != null and lawEnforcementBasis != ''">law_enforcement_basis = #{lawEnforcementBasis},</if> |
|||
<if test="lawEnforcementBasisText != null and lawEnforcementBasisText != ''">law_enforcement_basis_text = #{lawEnforcementBasisText},</if> |
|||
<if test="remark != null and remark != ''">remark = #{remark},</if> |
|||
<if test="reason != null and reason != ''">reason = #{reason},</if> |
|||
<if test="reslut != null ">reslut = #{reslut},</if> |
|||
<if test="status != null ">status = #{status},</if> |
|||
<if test="hasDelete != null ">has_delete = #{hasDelete},</if> |
|||
<if test="hasComplaint != null ">has_complaint = #{hasComplaint},</if> |
|||
<if test="hasSubmit != null ">has_submit = #{hasSubmit},</if> |
|||
<if test="hasEvaluate != null ">has_evaluate = #{hasEvaluate},</if> |
|||
<if test="lawId != null and lawId != ''">law_id = #{lawId},</if> |
|||
<if test="lawText != null and lawText != ''">law_text = #{lawText},</if> |
|||
<if test="bureauDeptId != null and bureauDeptId != ''">bureau_dept_id = #{bureauDeptId},</if> |
|||
<if test="bureauDeptName != null and bureauDeptName != ''">bureau_dept_name = #{bureauDeptName},</if> |
|||
<if test="creditcode != null and creditcode != ''">creditcode = #{creditcode},</if> |
|||
<if test="userId != null and userId != ''">user_id = #{userId},</if> |
|||
<if test="deptId != null and deptId != ''">dept_id = #{deptId},</if> |
|||
<if test="createBy != null and createBy != ''">create_by = #{createBy},</if> |
|||
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if> |
|||
<if test="createTime != null ">create_time = #{createTime},</if> |
|||
<if test="updateTime != null ">update_time = #{updateTime},</if> |
|||
</trim> |
|||
where id = #{id} |
|||
</update> |
|||
|
|||
<delete id="deleteNonEnforcementRegistrationById" parameterType="String"> |
|||
delete from non_enforcement_registration where id = #{id} |
|||
</delete> |
|||
|
|||
<delete id="deleteNonEnforcementRegistrationByIds" parameterType="String"> |
|||
delete from non_enforcement_registration where id in |
|||
<foreach item="id" collection="array" open="(" separator="," close=")"> |
|||
#{id} |
|||
</foreach> |
|||
</delete> |
|||
|
|||
<select id="getListTotal" parameterType="com.zdxt.enforcementcode.domain.bo.NonEnforcementRegistrationBo" resultType="Integer"> |
|||
select count(*) from non_enforcement_registration |
|||
<where> |
|||
<if test="enterpriseName != null and enterpriseName != ''"> and enterprise_name like concat('%', #{enterpriseName}, '%')</if> |
|||
<if test="enterpriseNumber != null and enterpriseNumber != ''"> and enterprise_number = #{enterpriseNumber}</if> |
|||
<if test="enforcementTime != null "> and enforcement_time = #{enforcementTime}</if> |
|||
<if test="lawEnforcer != null and lawEnforcer != ''"> and law_enforcer = #{lawEnforcer}</if> |
|||
<if test="lawEnforcerId != null and lawEnforcerId != ''"> and law_enforcer_id = #{lawEnforcerId}</if> |
|||
<if test="lawEnforcerOther != null and lawEnforcerOther != ''"> and law_enforcer_other = #{lawEnforcerOther}</if> |
|||
<if test="lawEnforcerIdOther != null and lawEnforcerIdOther != ''"> and law_enforcer_id_other = #{lawEnforcerIdOther}</if> |
|||
<if test="lawEnforcementType != null "> and law_enforcement_type = #{lawEnforcementType}</if> |
|||
<if test="lawEnforcementTypeText != null and lawEnforcementTypeText != ''"> and law_enforcement_type_text = #{lawEnforcementTypeText}</if> |
|||
<if test="lawEnforcementItem != null "> and law_enforcement_item = #{lawEnforcementItem}</if> |
|||
<if test="lawEnforcementItemText != null and lawEnforcementItemText != ''"> and law_enforcement_item_text = #{lawEnforcementItemText}</if> |
|||
<if test="lawEnforcementBasis != null and lawEnforcementBasis != ''"> and law_enforcement_basis = #{lawEnforcementBasis}</if> |
|||
<if test="lawEnforcementBasisText != null and lawEnforcementBasisText != ''"> and law_enforcement_basis_text = #{lawEnforcementBasisText}</if> |
|||
<if test="reslut != null and reslut != ''"> and reslut = #{reslut}</if> |
|||
<if test="status != null and status != ''"> and status = #{status}</if> |
|||
<if test="hasDelete != null and hasDelete != ''"> and has_delete = #{hasDelete}</if> |
|||
<if test="hasComplaint != null and hasComplaint != ''"> and has_complaint = #{hasComplaint}</if> |
|||
<if test="hasSubmit != null and hasSubmit != ''"> and has_submit = #{hasSubmit}</if> |
|||
<if test="hasEvaluate != null and hasEvaluate != ''"> and has_evaluate = #{hasEvaluate}</if> |
|||
<if test="lawId != null and lawId != ''"> and law_id = #{lawId}</if> |
|||
<if test="lawText != null and lawText != ''"> and law_text = #{lawText}</if> |
|||
<if test="bureauDeptId != null and bureauDeptId != ''"> and bureau_dept_id = #{bureauDeptId}</if> |
|||
<if test="bureauDeptName != null and bureauDeptName != ''"> and bureau_dept_name like concat('%', #{bureauDeptName}, '%')</if> |
|||
<if test="creditcode != null and creditcode != ''"> and creditcode = #{creditcode}</if> |
|||
<if test="userId != null and userId != ''"> and user_id = #{userId}</if> |
|||
<if test="deptId != null and deptId != ''"> and dept_id = #{deptId}</if> |
|||
<if test="searchValue != null and searchValue != ''"> |
|||
and (law_enforcement_type_text like concat('%',#{searchValue},'%') |
|||
or bureau_dept_name like concat('%',#{searchValue},'%') |
|||
or law_enforcer like concat('%',#{searchValue},'%') |
|||
or law_enforcer_other like concat('%',#{searchValue},'%') |
|||
) |
|||
</if> |
|||
<if test="dateType != null and dateType == 1"> |
|||
and DATE_FORMAT(enforcement_time, '%Y-%m') = DATE_FORMAT(CURDATE(), '%Y-%m') |
|||
</if> |
|||
<if test="dateType != null and dateType == 2"> |
|||
AND DATE_FORMAT(enforcement_time, '%Y-%m') >= CONCAT(YEAR(CURDATE()), '-', |
|||
CASE WHEN QUARTER(CURDATE()) IN (1) THEN '01' |
|||
WHEN QUARTER(CURDATE()) IN (2) THEN '04' |
|||
WHEN QUARTER(CURDATE()) IN (3) THEN '07' |
|||
ELSE '10' END) |
|||
and DATE_FORMAT(enforcement_time, '%Y-%m') <= CONCAT(YEAR(CURDATE()), '-', |
|||
CASE |
|||
WHEN QUARTER(CURDATE()) IN (1) THEN '03' |
|||
WHEN QUARTER(CURDATE()) IN (2) THEN '06' |
|||
WHEN QUARTER(CURDATE()) IN (3) THEN '09' |
|||
ELSE '12' |
|||
END) |
|||
</if> |
|||
<if test="dateType != null and dateType == 3"> |
|||
and DATE_FORMAT(enforcement_time, '%Y') = DATE_FORMAT(CURDATE(), '%Y') |
|||
</if> |
|||
<if test="dateSearch != null and dateSearch != ''"> |
|||
and DATE_FORMAT(enforcement_time, '%Y-%m') = #{dateSearch} |
|||
</if> |
|||
</where> |
|||
order by enforcement_time desc |
|||
</select> |
|||
|
|||
</mapper> |
|||
Loading…
Reference in new issue