Browse Source

fix mybatis mapper sql judgment condition of foreach statement. (#4964)

pull/3/MERGE
zhuangchong 4 years ago committed by GitHub
parent
commit
d13fab7497
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      dolphinscheduler-dao/src/main/resources/org/apache/dolphinscheduler/dao/mapper/DataSourceMapper.xml
  2. 2
      dolphinscheduler-dao/src/main/resources/org/apache/dolphinscheduler/dao/mapper/ProcessInstanceMapper.xml
  3. 4
      dolphinscheduler-dao/src/main/resources/org/apache/dolphinscheduler/dao/mapper/ResourceMapper.xml
  4. 8
      dolphinscheduler-dao/src/main/resources/org/apache/dolphinscheduler/dao/mapper/UdfFuncMapper.xml

2
dolphinscheduler-dao/src/main/resources/org/apache/dolphinscheduler/dao/mapper/DataSourceMapper.xml

@ -91,7 +91,7 @@
where where
id in (select datasource_id from t_ds_relation_datasource_user where user_id=#{userId} id in (select datasource_id from t_ds_relation_datasource_user where user_id=#{userId}
union select id as datasource_id from t_ds_datasource where user_id=#{userId}) union select id as datasource_id from t_ds_datasource where user_id=#{userId})
<if test="dataSourceIds != null and dataSourceIds != ''"> <if test="dataSourceIds != null and dataSourceIds.length > 0">
and id in and id in
<foreach collection="dataSourceIds" item="i" open="(" close=")" separator=","> <foreach collection="dataSourceIds" item="i" open="(" close=")" separator=",">
#{i} #{i}

2
dolphinscheduler-dao/src/main/resources/org/apache/dolphinscheduler/dao/mapper/ProcessInstanceMapper.xml

@ -104,7 +104,7 @@
<if test="startTime != null "> <if test="startTime != null ">
and instance.start_time > #{startTime} and instance.start_time <![CDATA[ <=]]> #{endTime} and instance.start_time > #{startTime} and instance.start_time <![CDATA[ <=]]> #{endTime}
</if> </if>
<if test="states != null and states != ''"> <if test="states != null and states.length > 0">
and instance.state in and instance.state in
<foreach collection="states" index="index" item="i" open="(" separator="," close=")"> <foreach collection="states" index="index" item="i" open="(" separator="," close=")">
#{i} #{i}

4
dolphinscheduler-dao/src/main/resources/org/apache/dolphinscheduler/dao/mapper/ResourceMapper.xml

@ -102,7 +102,7 @@
where type=0 where type=0
and id in (select resources_id from t_ds_relation_resources_user where user_id=#{userId} and perm=7 and id in (select resources_id from t_ds_relation_resources_user where user_id=#{userId} and perm=7
union select id as resources_id from t_ds_resources where user_id=#{userId}) union select id as resources_id from t_ds_resources where user_id=#{userId})
<if test="resNames != null and resNames != ''"> <if test="resNames != null and resNames.length > 0">
and full_name in and full_name in
<foreach collection="resNames" item="i" open="(" close=")" separator=","> <foreach collection="resNames" item="i" open="(" close=")" separator=",">
#{i} #{i}
@ -115,7 +115,7 @@
from t_ds_resources from t_ds_resources
where id in (select resources_id from t_ds_relation_resources_user where user_id=#{userId} and perm=7 where id in (select resources_id from t_ds_relation_resources_user where user_id=#{userId} and perm=7
union select id as resources_id from t_ds_resources where user_id=#{userId}) union select id as resources_id from t_ds_resources where user_id=#{userId})
<if test="resIds != null and resIds != ''"> <if test="resIds != null and resIds.length > 0">
and id in and id in
<foreach collection="resIds" item="i" open="(" close=")" separator=","> <foreach collection="resIds" item="i" open="(" close=")" separator=",">
#{i} #{i}

8
dolphinscheduler-dao/src/main/resources/org/apache/dolphinscheduler/dao/mapper/UdfFuncMapper.xml

@ -40,7 +40,7 @@
</include> </include>
from t_ds_udfs udf from t_ds_udfs udf
where 1 = 1 where 1 = 1
<if test="ids != null and ids != ''"> <if test="ids != null and ids.length > 0">
and udf.id in and udf.id in
<foreach collection="ids" item="i" open="(" close=")" separator=","> <foreach collection="ids" item="i" open="(" close=")" separator=",">
#{i} #{i}
@ -107,7 +107,7 @@
where where
udf.id in (select udf_id from t_ds_relation_udfs_user where user_id=#{userId} udf.id in (select udf_id from t_ds_relation_udfs_user where user_id=#{userId}
union select id as udf_id from t_ds_udfs where user_id=#{userId}) union select id as udf_id from t_ds_udfs where user_id=#{userId})
<if test="udfIds != null and udfIds != ''"> <if test="udfIds != null and udfIds.length > 0">
and udf.id in and udf.id in
<foreach collection="udfIds" item="i" open="(" close=")" separator=","> <foreach collection="udfIds" item="i" open="(" close=")" separator=",">
#{i} #{i}
@ -121,7 +121,7 @@
</include> </include>
from t_ds_udfs udf from t_ds_udfs udf
where 1=1 where 1=1
<if test="resourceIds != null and resourceIds != ''"> <if test="resourceIds != null and resourceIds.length > 0">
and udf.resource_id in and udf.resource_id in
<foreach collection="resourceIds" item="i" open="(" close=")" separator=","> <foreach collection="resourceIds" item="i" open="(" close=")" separator=",">
#{i} #{i}
@ -137,7 +137,7 @@
where where
udf.id in (select udf_id from t_ds_relation_udfs_user where user_id=#{userId} udf.id in (select udf_id from t_ds_relation_udfs_user where user_id=#{userId}
union select id as udf_id from t_ds_udfs where user_id=#{userId}) union select id as udf_id from t_ds_udfs where user_id=#{userId})
<if test="resourceIds != null and resourceIds != ''"> <if test="resourceIds != null and resourceIds.length > 0">
and udf.resource_id in and udf.resource_id in
<foreach collection="resourceIds" item="i" open="(" close=")" separator=","> <foreach collection="resourceIds" item="i" open="(" close=")" separator=",">
#{i} #{i}

Loading…
Cancel
Save