|
@@ -881,7 +881,7 @@
|
|
|
a.del_flag = 0
|
|
a.del_flag = 0
|
|
|
<if test="type == 1">
|
|
<if test="type == 1">
|
|
|
<!-- and (d.top_ent_id = #{entId} or d.ent_id = #{entId})-->
|
|
<!-- and (d.top_ent_id = #{entId} or d.ent_id = #{entId})-->
|
|
|
- AND (
|
|
|
|
|
|
|
+ AND ((
|
|
|
a.ent_id = #{entId}
|
|
a.ent_id = #{entId}
|
|
|
<if test="userIds != null and userIds.size()>0">
|
|
<if test="userIds != null and userIds.size()>0">
|
|
|
AND a.create_by IN
|
|
AND a.create_by IN
|
|
@@ -898,11 +898,11 @@
|
|
|
#{item}
|
|
#{item}
|
|
|
</foreach>
|
|
</foreach>
|
|
|
</if>
|
|
</if>
|
|
|
- )
|
|
|
|
|
|
|
+ ))
|
|
|
</if>
|
|
</if>
|
|
|
<if test="type == 2">
|
|
<if test="type == 2">
|
|
|
<!-- and (e.top_ent_id = #{entId} or e.ent_id = #{entId})-->
|
|
<!-- and (e.top_ent_id = #{entId} or e.ent_id = #{entId})-->
|
|
|
- AND (
|
|
|
|
|
|
|
+ AND ((
|
|
|
a.ent_id = #{entId}
|
|
a.ent_id = #{entId}
|
|
|
<if test="userIds != null and userIds.size()>0">
|
|
<if test="userIds != null and userIds.size()>0">
|
|
|
AND a.create_by IN
|
|
AND a.create_by IN
|
|
@@ -912,14 +912,14 @@
|
|
|
</if>
|
|
</if>
|
|
|
)
|
|
)
|
|
|
OR (
|
|
OR (
|
|
|
- d.top_ent_id = #{entId}
|
|
|
|
|
|
|
+ e.top_ent_id = #{entId}
|
|
|
<if test="contactsIds != null and contactsIds.size()>0">
|
|
<if test="contactsIds != null and contactsIds.size()>0">
|
|
|
- AND d.contacts_id IN
|
|
|
|
|
|
|
+ AND e.contacts_id IN
|
|
|
<foreach collection="contactsIds" separator="," item="item" close=")" open="(">
|
|
<foreach collection="contactsIds" separator="," item="item" close=")" open="(">
|
|
|
#{item}
|
|
#{item}
|
|
|
</foreach>
|
|
</foreach>
|
|
|
</if>
|
|
</if>
|
|
|
- )
|
|
|
|
|
|
|
+ ))
|
|
|
</if>
|
|
</if>
|
|
|
<if test="query.keywords != null and query.keywords != ''">
|
|
<if test="query.keywords != null and query.keywords != ''">
|
|
|
and (
|
|
and (
|
|
@@ -1105,46 +1105,46 @@
|
|
|
<where>
|
|
<where>
|
|
|
a.del_flag = 0
|
|
a.del_flag = 0
|
|
|
<if test="type == 1">
|
|
<if test="type == 1">
|
|
|
- and (d.top_ent_id = #{entId} or d.ent_id = #{entId})
|
|
|
|
|
- <!-- AND (-->
|
|
|
|
|
- <!-- a.ent_id = #{entId}-->
|
|
|
|
|
- <!-- <if test="userIds != null and userIds.size()>0">-->
|
|
|
|
|
- <!-- AND a.create_by IN-->
|
|
|
|
|
- <!-- <foreach collection="userIds" open="(" close=")" item="item" separator=",">-->
|
|
|
|
|
- <!-- #{item}-->
|
|
|
|
|
- <!-- </foreach>-->
|
|
|
|
|
- <!-- </if>-->
|
|
|
|
|
- <!-- )-->
|
|
|
|
|
- <!-- OR (-->
|
|
|
|
|
- <!-- d.top_ent_id = #{entId}-->
|
|
|
|
|
- <!-- <if test="contactsIds != null and contactsIds.size()>0">-->
|
|
|
|
|
- <!-- AND d.contacts_id IN-->
|
|
|
|
|
- <!-- <foreach collection="contactsIds" separator="," item="item" close=")" open="(">-->
|
|
|
|
|
- <!-- #{item}-->
|
|
|
|
|
- <!-- </foreach>-->
|
|
|
|
|
- <!-- </if>-->
|
|
|
|
|
- <!-- )-->
|
|
|
|
|
|
|
+<!-- and (d.top_ent_id = #{entId} or d.ent_id = #{entId})-->
|
|
|
|
|
+ AND ((
|
|
|
|
|
+ a.ent_id = #{entId}
|
|
|
|
|
+ <if test="userIds != null and userIds.size()>0">
|
|
|
|
|
+ AND a.create_by IN
|
|
|
|
|
+ <foreach collection="userIds" open="(" close=")" item="item" separator=",">
|
|
|
|
|
+ #{item}
|
|
|
|
|
+ </foreach>
|
|
|
|
|
+ </if>
|
|
|
|
|
+ )
|
|
|
|
|
+ OR (
|
|
|
|
|
+ d.top_ent_id = #{entId}
|
|
|
|
|
+ <if test="contactsIds != null and contactsIds.size()>0">
|
|
|
|
|
+ AND d.contacts_id IN
|
|
|
|
|
+ <foreach collection="contactsIds" separator="," item="item" close=")" open="(">
|
|
|
|
|
+ #{item}
|
|
|
|
|
+ </foreach>
|
|
|
|
|
+ </if>
|
|
|
|
|
+ ))
|
|
|
</if>
|
|
</if>
|
|
|
<if test="type == 2">
|
|
<if test="type == 2">
|
|
|
- and (e.top_ent_id = #{entId} or e.ent_id = #{entId})
|
|
|
|
|
- <!-- AND (-->
|
|
|
|
|
- <!-- a.ent_id = #{entId}-->
|
|
|
|
|
- <!-- <if test="userIds != null and userIds.size()>0">-->
|
|
|
|
|
- <!-- AND a.create_by IN-->
|
|
|
|
|
- <!-- <foreach collection="userIds" open="(" close=")" item="item" separator=",">-->
|
|
|
|
|
- <!-- #{item}-->
|
|
|
|
|
- <!-- </foreach>-->
|
|
|
|
|
- <!-- </if>-->
|
|
|
|
|
- <!-- )-->
|
|
|
|
|
- <!-- OR (-->
|
|
|
|
|
- <!-- d.top_ent_id = #{entId}-->
|
|
|
|
|
- <!-- <if test="contactsIds != null and contactsIds.size()>0">-->
|
|
|
|
|
- <!-- AND d.contacts_id IN-->
|
|
|
|
|
- <!-- <foreach collection="contactsIds" separator="," item="item" close=")" open="(">-->
|
|
|
|
|
- <!-- #{item}-->
|
|
|
|
|
- <!-- </foreach>-->
|
|
|
|
|
- <!-- </if>-->
|
|
|
|
|
- <!-- )-->
|
|
|
|
|
|
|
+<!-- and (e.top_ent_id = #{entId} or e.ent_id = #{entId})-->
|
|
|
|
|
+ AND ((
|
|
|
|
|
+ a.ent_id = #{entId}
|
|
|
|
|
+ <if test="userIds != null and userIds.size()>0">
|
|
|
|
|
+ AND a.create_by IN
|
|
|
|
|
+ <foreach collection="userIds" open="(" close=")" item="item" separator=",">
|
|
|
|
|
+ #{item}
|
|
|
|
|
+ </foreach>
|
|
|
|
|
+ </if>
|
|
|
|
|
+ )
|
|
|
|
|
+ OR (
|
|
|
|
|
+ e.top_ent_id = #{entId}
|
|
|
|
|
+ <if test="contactsIds != null and contactsIds.size()>0">
|
|
|
|
|
+ AND e.contacts_id IN
|
|
|
|
|
+ <foreach collection="contactsIds" separator="," item="item" close=")" open="(">
|
|
|
|
|
+ #{item}
|
|
|
|
|
+ </foreach>
|
|
|
|
|
+ </if>
|
|
|
|
|
+ ))
|
|
|
</if>
|
|
</if>
|
|
|
<if test="query.keywords != null and query.keywords != ''">
|
|
<if test="query.keywords != null and query.keywords != ''">
|
|
|
and (
|
|
and (
|
|
@@ -1160,6 +1160,12 @@
|
|
|
#{status}
|
|
#{status}
|
|
|
</foreach>
|
|
</foreach>
|
|
|
</if>
|
|
</if>
|
|
|
|
|
+ <if test="idsList != null and idsList.size() > 0 ">
|
|
|
|
|
+ and a.id in
|
|
|
|
|
+ <foreach collection="idsList" item="item" open="(" close=")" separator=",">
|
|
|
|
|
+ #{item}
|
|
|
|
|
+ </foreach>
|
|
|
|
|
+ </if>
|
|
|
<if test="query.endBeginDateTime != null and query.endBeginDateTime != '' ">
|
|
<if test="query.endBeginDateTime != null and query.endBeginDateTime != '' ">
|
|
|
and DATE( a.end_time) <![CDATA[ >= ]]> #{query.endBeginDateTime}
|
|
and DATE( a.end_time) <![CDATA[ >= ]]> #{query.endBeginDateTime}
|
|
|
</if>
|
|
</if>
|
|
@@ -1425,46 +1431,46 @@
|
|
|
<where>
|
|
<where>
|
|
|
a.del_flag = 0
|
|
a.del_flag = 0
|
|
|
<if test="type == 1">
|
|
<if test="type == 1">
|
|
|
- and (d.top_ent_id = #{entId} or d.ent_id = #{entId})
|
|
|
|
|
- <!-- AND (-->
|
|
|
|
|
- <!-- a.ent_id = #{entId}-->
|
|
|
|
|
- <!-- <if test="userIds != null and userIds.size()>0">-->
|
|
|
|
|
- <!-- AND a.create_by IN-->
|
|
|
|
|
- <!-- <foreach collection="userIds" open="(" close=")" item="item" separator=",">-->
|
|
|
|
|
- <!-- #{item}-->
|
|
|
|
|
- <!-- </foreach>-->
|
|
|
|
|
- <!-- </if>-->
|
|
|
|
|
- <!-- )-->
|
|
|
|
|
- <!-- OR (-->
|
|
|
|
|
- <!-- d.top_ent_id = #{entId}-->
|
|
|
|
|
- <!-- <if test="contactsIds != null and contactsIds.size()>0">-->
|
|
|
|
|
- <!-- AND d.contacts_id IN-->
|
|
|
|
|
- <!-- <foreach collection="contactsIds" separator="," item="item" close=")" open="(">-->
|
|
|
|
|
- <!-- #{item}-->
|
|
|
|
|
- <!-- </foreach>-->
|
|
|
|
|
- <!-- </if>-->
|
|
|
|
|
- <!-- )-->
|
|
|
|
|
|
|
+<!-- and (d.top_ent_id = #{entId} or d.ent_id = #{entId})-->
|
|
|
|
|
+ AND ((
|
|
|
|
|
+ a.ent_id = #{entId}
|
|
|
|
|
+ <if test="userIds != null and userIds.size()>0">
|
|
|
|
|
+ AND a.create_by IN
|
|
|
|
|
+ <foreach collection="userIds" open="(" close=")" item="item" separator=",">
|
|
|
|
|
+ #{item}
|
|
|
|
|
+ </foreach>
|
|
|
|
|
+ </if>
|
|
|
|
|
+ )
|
|
|
|
|
+ OR (
|
|
|
|
|
+ d.top_ent_id = #{entId}
|
|
|
|
|
+ <if test="contactsIds != null and contactsIds.size()>0">
|
|
|
|
|
+ AND d.contacts_id IN
|
|
|
|
|
+ <foreach collection="contactsIds" separator="," item="item" close=")" open="(">
|
|
|
|
|
+ #{item}
|
|
|
|
|
+ </foreach>
|
|
|
|
|
+ </if>
|
|
|
|
|
+ ))
|
|
|
</if>
|
|
</if>
|
|
|
<if test="type == 2">
|
|
<if test="type == 2">
|
|
|
- and (e.top_ent_id = #{entId} or e.ent_id = #{entId})
|
|
|
|
|
- <!-- AND (-->
|
|
|
|
|
- <!-- a.ent_id = #{entId}-->
|
|
|
|
|
- <!-- <if test="userIds != null and userIds.size()>0">-->
|
|
|
|
|
- <!-- AND a.create_by IN-->
|
|
|
|
|
- <!-- <foreach collection="userIds" open="(" close=")" item="item" separator=",">-->
|
|
|
|
|
- <!-- #{item}-->
|
|
|
|
|
- <!-- </foreach>-->
|
|
|
|
|
- <!-- </if>-->
|
|
|
|
|
- <!-- )-->
|
|
|
|
|
- <!-- OR (-->
|
|
|
|
|
- <!-- d.top_ent_id = #{entId}-->
|
|
|
|
|
- <!-- <if test="contactsIds != null and contactsIds.size()>0">-->
|
|
|
|
|
- <!-- AND d.contacts_id IN-->
|
|
|
|
|
- <!-- <foreach collection="contactsIds" separator="," item="item" close=")" open="(">-->
|
|
|
|
|
- <!-- #{item}-->
|
|
|
|
|
- <!-- </foreach>-->
|
|
|
|
|
- <!-- </if>-->
|
|
|
|
|
- <!-- )-->
|
|
|
|
|
|
|
+<!-- and (e.top_ent_id = #{entId} or e.ent_id = #{entId})-->
|
|
|
|
|
+ AND ((
|
|
|
|
|
+ a.ent_id = #{entId}
|
|
|
|
|
+ <if test="userIds != null and userIds.size()>0">
|
|
|
|
|
+ AND a.create_by IN
|
|
|
|
|
+ <foreach collection="userIds" open="(" close=")" item="item" separator=",">
|
|
|
|
|
+ #{item}
|
|
|
|
|
+ </foreach>
|
|
|
|
|
+ </if>
|
|
|
|
|
+ )
|
|
|
|
|
+ OR (
|
|
|
|
|
+ e.top_ent_id = #{entId}
|
|
|
|
|
+ <if test="contactsIds != null and contactsIds.size()>0">
|
|
|
|
|
+ AND e.contacts_id IN
|
|
|
|
|
+ <foreach collection="contactsIds" separator="," item="item" close=")" open="(">
|
|
|
|
|
+ #{item}
|
|
|
|
|
+ </foreach>
|
|
|
|
|
+ </if>
|
|
|
|
|
+ ))
|
|
|
</if>
|
|
</if>
|
|
|
<if test="query.keywords != null and query.keywords != ''">
|
|
<if test="query.keywords != null and query.keywords != ''">
|
|
|
and (
|
|
and (
|
|
@@ -1480,6 +1486,12 @@
|
|
|
#{status}
|
|
#{status}
|
|
|
</foreach>
|
|
</foreach>
|
|
|
</if>
|
|
</if>
|
|
|
|
|
+ <if test="idsList != null and idsList.size() > 0 ">
|
|
|
|
|
+ and a.status in
|
|
|
|
|
+ <foreach collection="idsList" item="status" open="(" close=")" separator=",">
|
|
|
|
|
+ #{status}
|
|
|
|
|
+ </foreach>
|
|
|
|
|
+ </if>
|
|
|
<if test="query.endBeginDateTime != null and query.endBeginDateTime != '' ">
|
|
<if test="query.endBeginDateTime != null and query.endBeginDateTime != '' ">
|
|
|
and DATE( a.end_time) <![CDATA[ >= ]]> #{query.endBeginDateTime}
|
|
and DATE( a.end_time) <![CDATA[ >= ]]> #{query.endBeginDateTime}
|
|
|
</if>
|
|
</if>
|