Commit 026ced37 authored by 麻笑宇's avatar 麻笑宇

refactor(amos-boot): 优化企业查询条件处理

- 将创建时间区间拆分为开始时间和结束时间,提高查询灵活性 -增加对监管标签的精确处理,支持"无标签"查询 - 优化地址、设备类型等查询条件
parent 72fd1c08
...@@ -33,8 +33,12 @@ ...@@ -33,8 +33,12 @@
FROM FROM
tz_base_enterprise_info tz_base_enterprise_info
<where> <where>
<if test="tzBaseEnterpriseInfoDto.createDateRange != null"> <if test="tzBaseEnterpriseInfoDto.startCreateDate != null and tzBaseEnterpriseInfoDto.startCreateDate != ''">
AND create_date BETWEEN #{tzBaseEnterpriseInfoDto.createDateRange[0]} AND #{tzBaseEnterpriseInfoDto.createDateRange[1]} AND create_date &gt;= #{tzBaseEnterpriseInfoDto.startCreateDate}
</if>
<if test="tzBaseEnterpriseInfoDto.endCreateDate != null and tzBaseEnterpriseInfoDto.endCreateDate != ''">
AND create_date &lt;= #{tzBaseEnterpriseInfoDto.endCreateDate}
</if> </if>
<if test="tzBaseEnterpriseInfoDto.unitType.indexOf('检验检测机构') !=-1 and tzBaseEnterpriseInfoDto.jyjcStatus!=null and tzBaseEnterpriseInfoDto.jyjcStatus!=''"> <if test="tzBaseEnterpriseInfoDto.unitType.indexOf('检验检测机构') !=-1 and tzBaseEnterpriseInfoDto.jyjcStatus!=null and tzBaseEnterpriseInfoDto.jyjcStatus!=''">
use_unit_code in use_unit_code in
...@@ -89,9 +93,14 @@ ...@@ -89,9 +93,14 @@
test="tzBaseEnterpriseInfoDto.address!=null and tzBaseEnterpriseInfoDto.address!='' "> test="tzBaseEnterpriseInfoDto.address!=null and tzBaseEnterpriseInfoDto.address!='' ">
AND address LIKE CONCAT('%',#{tzBaseEnterpriseInfoDto.address},'%') AND address LIKE CONCAT('%',#{tzBaseEnterpriseInfoDto.address},'%')
</if> </if>
<if test="tzBaseEnterpriseInfoDto.regulatoryLabels!=null and tzBaseEnterpriseInfoDto.regulatoryLabels!='' "> <if test="tzBaseEnterpriseInfoDto.regulatoryLabels!=null and tzBaseEnterpriseInfoDto.regulatoryLabels!='' and tzBaseEnterpriseInfoDto.regulatoryLabels=='nothave'">
AND regulatory_labels is null
</if>
<if test="tzBaseEnterpriseInfoDto.regulatoryLabels!=null and tzBaseEnterpriseInfoDto.regulatoryLabels!='' and tzBaseEnterpriseInfoDto.regulatoryLabels!='nothave'">
AND regulatory_labels LIKE CONCAT('%',#{tzBaseEnterpriseInfoDto.regulatoryLabels},'%') AND regulatory_labels LIKE CONCAT('%',#{tzBaseEnterpriseInfoDto.regulatoryLabels},'%')
</if> </if>
<if test="tzBaseEnterpriseInfoDto.equipType!=null and tzBaseEnterpriseInfoDto.equipType!='' "> <if test="tzBaseEnterpriseInfoDto.equipType!=null and tzBaseEnterpriseInfoDto.equipType!='' ">
AND equip_category LIKE CONCAT('%',#{tzBaseEnterpriseInfoDto.equipType},'%') AND equip_category LIKE CONCAT('%',#{tzBaseEnterpriseInfoDto.equipType},'%')
</if> </if>
......
...@@ -333,6 +333,8 @@ public class TzBaseEnterpriseInfoDto extends BaseDto { ...@@ -333,6 +333,8 @@ public class TzBaseEnterpriseInfoDto extends BaseDto {
@ApiModelProperty(value = "创建时间") @ApiModelProperty(value = "创建时间")
private Date createDate; private Date createDate;
@ApiModelProperty(value = "创建时间区间") @ApiModelProperty(value = "创建时间区间开始")
private String[] createDateRange; private String startCreateDate;
@ApiModelProperty(value = "创建时间区间结束")
private String endCreateDate;
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment