Commit abff60b6 authored by 赵啸非's avatar 赵啸非

修改查询差集没有条件的时候sql异常

parent ea836d5b
......@@ -284,6 +284,7 @@ public class MatterServiceImpl extends AbstractCRUDServiceImpl<MatterDao, Matter
@Override
public Result<MatterEntity> findSubList(MatterEntity matterQuery, PageInfo pageInfo, Context context) throws AppException {
SiteEntity siteCache = siteService.getCache(matterQuery.getSiteId().toString());
if(ObjectUtils.isEmpty(siteCache)) throw new AppException("查询站点id不能为空!");
if (ObjectUtils.isEmpty(matterQuery.getAreaCode())) {
matterQuery.setAreaCode(siteCache == null ? null : siteCache.getAreaCode());
}
......
......@@ -10,12 +10,12 @@
LEFT JOIN ( SELECT matterCode FROM mortals_sys_site_matter
<trim suffixOverrides="where" suffix="">
<if test="condition.siteId!=null and condition.siteId!=''">
where siteId = #{condition.siteId,jdbcType=VARCHAR}
where siteId = #{condition.siteId}
</if>
</trim>
)AS b ON a.matterNo = b.matterCode
<trim suffixOverrides="where" suffix="">
where b.matterCode IS NULL
where b.matterCode IS NULL and
<trim prefixOverrides="and" prefix="">
<if test="condition.areaCode!=null and condition.areaCode!=''">
and a.areaCode = #{condition.areaCode,jdbcType=VARCHAR}
......@@ -47,7 +47,7 @@
</trim>
) AS b ON a.matterNo = b.matterCode
<trim suffixOverrides="where" suffix="">
where b.matterCode IS NULL
where b.matterCode IS NULL and
<trim prefixOverrides="and" prefix="">
<if test="condition.areaCode!=null and condition.areaCode!=''">
and a.areaCode = #{condition.areaCode,jdbcType=VARCHAR}
......
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