|
|
@@ -381,6 +381,20 @@
|
|
|
left join t_order_new ton on a.order_no =ton.order_no
|
|
|
</if>
|
|
|
where 1=1
|
|
|
+ <include refid="listPublicReleaseSql"/>
|
|
|
+ <if test="type==2 or type==4">
|
|
|
+ ORDER BY a.create_time desc
|
|
|
+ </if>
|
|
|
+ <if test="type==0 or type==1 or type==3">
|
|
|
+ ORDER BY (case when a.status=1 then 1 when a.status=2 then 2 when a.status=3 then 5
|
|
|
+ when a.status=0 then 3 when a.status=4 then 4
|
|
|
+ else 0 end),a.create_time desc
|
|
|
+ </if>
|
|
|
+ <if test="page_sql!=null">
|
|
|
+ ${page_sql}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+ <sql id="listPublicReleaseSql">
|
|
|
<if test="type==0">
|
|
|
and a.public_type in (0,1,2,3)
|
|
|
<if test="assist ==0">
|
|
|
@@ -408,6 +422,7 @@
|
|
|
<if test="type==1">
|
|
|
and a.public_type in (0,2)
|
|
|
and a.assist in(0,1)
|
|
|
+ and a.tech_start_process in (0,2)
|
|
|
and c.reviewer = #{aid}
|
|
|
</if>
|
|
|
<if test="type==2">
|
|
|
@@ -447,18 +462,7 @@
|
|
|
<if test="status !=null">
|
|
|
and a.status = #{status}
|
|
|
</if>
|
|
|
- <if test="type==2 or type==4">
|
|
|
- ORDER BY a.create_time desc
|
|
|
- </if>
|
|
|
- <if test="type==0 or type==1 or type==3">
|
|
|
- ORDER BY (case when a.status=1 then 1 when a.status=2 then 2 when a.status=3 then 5
|
|
|
- when a.status=0 then 3 when a.status=4 then 4
|
|
|
- else 0 end),a.create_time desc
|
|
|
- </if>
|
|
|
- <if test="page_sql!=null">
|
|
|
- ${page_sql}
|
|
|
- </if>
|
|
|
- </select>
|
|
|
+ </sql>
|
|
|
<select id="countPublicRelease" resultType="java.lang.Integer">
|
|
|
select count(*)
|
|
|
from public_release a left join admin c on a.aid =c.id
|
|
|
@@ -473,70 +477,7 @@
|
|
|
left join t_order_new ton on a.order_no =ton.order_no
|
|
|
</if>
|
|
|
where 1=1
|
|
|
- <if test="type==0">
|
|
|
- and a.public_type in (0,1,2,3)
|
|
|
- <if test="assist ==0">
|
|
|
- and a.assist in(0,1)
|
|
|
- </if>
|
|
|
- <if test="assist == 2">
|
|
|
- and a.assist =2
|
|
|
- </if>
|
|
|
- <if test="assist == 3">
|
|
|
- and a.assist =3
|
|
|
- </if>
|
|
|
- <if test="assist ==4">
|
|
|
- and a.assist in (2,3)
|
|
|
- </if>
|
|
|
- <if test="assistType ==1">
|
|
|
- and a.assist in(0,1,2)
|
|
|
- </if>
|
|
|
- <if test="aid !=null">
|
|
|
- and a.aid= #{aid}
|
|
|
- </if>
|
|
|
- <if test="statusType ==1">
|
|
|
- and a.status in (0,1,2,4)
|
|
|
- </if>
|
|
|
- </if>
|
|
|
- <if test="type==1">
|
|
|
- and a.public_type in (0,2)
|
|
|
- and a.assist in(0,1)
|
|
|
- and c.reviewer = #{aid}
|
|
|
- </if>
|
|
|
- <if test="type==2">
|
|
|
- and a.public_type in (0,2)
|
|
|
- and a.assist in(0,1)
|
|
|
- and d.manager_id = #{aid}
|
|
|
- </if>
|
|
|
- <if test="type==3">
|
|
|
- and a.public_type in (0,2)
|
|
|
- and a.assist=2
|
|
|
- <if test="aid !=null">
|
|
|
- and a.aid= #{aid}
|
|
|
- </if>
|
|
|
- and a.type = #{type}
|
|
|
- </if>
|
|
|
- <if test="type==4">
|
|
|
- and a.assist in(0,1)
|
|
|
- and e.aid = #{aid}
|
|
|
- and a.public_type in (1,2)
|
|
|
- </if>
|
|
|
- <if test="type==5">
|
|
|
- and a.tech_start_process=1
|
|
|
- and ton.salesman_id =#{aid}
|
|
|
- </if>
|
|
|
- <if test="userName !=null">
|
|
|
- and e.nickname like concat('%',#{userName},'%')
|
|
|
- </if>
|
|
|
- <if test="clockTime !=null">
|
|
|
- and a.release_start < #{clockTime} and a.release_end > #{clockTime}
|
|
|
- </if>
|
|
|
- <if test="releaseStarts != null and publicEnd != null">
|
|
|
- and a.release_start BETWEEN #{releaseStarts} and #{publicEnd}
|
|
|
- </if>
|
|
|
-
|
|
|
- <if test="status !=null">
|
|
|
- and a.status = #{status}
|
|
|
- </if>
|
|
|
+ <include refid="listPublicReleaseSql"/>
|
|
|
</select>
|
|
|
|
|
|
<select id="selectDtails" resultType="com.goafanti.weChat.bo.OutPublicRelease">
|