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

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

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