|
|
@@ -1968,6 +1968,122 @@
|
|
|
where split_super = #{tid}
|
|
|
</select>
|
|
|
|
|
|
+ <select id="selectProjectSotpList" resultType="com.goafanti.order.bo.OutselectProjectSotp">
|
|
|
+ select DATE_FORMAT(a.create_time,'%Y-%m-%d %H:%i:%S') createTimes,dg.name province,c.contract_no contractNo,
|
|
|
+ c.order_no orderNo ,tom.buyer_name userName,b.cname ,b.commodity_name projectName,b.commodity_quantity commodityQuantity ,
|
|
|
+ tom.service_type serviceType , b.receiver_name receiverName ,b.status ,b.commodity_price commodityPrice ,a.reason
|
|
|
+ from task_sopt a left join t_order_task b on a.tid=b.id
|
|
|
+ left join t_order_new c on b.order_no =c.order_no
|
|
|
+ left join t_order_mid tom on c.order_no =tom.order_no
|
|
|
+ left join department d on c.order_dep =d.id
|
|
|
+ left join district_glossory dg on d.province =dg.id
|
|
|
+ where 1=1
|
|
|
+ <if test="shiro ==1">
|
|
|
+ and c.salesman_id =#{aid}
|
|
|
+ </if>
|
|
|
+ <if test="shiro ==2">
|
|
|
+ and c.order_dep in
|
|
|
+ <foreach close=")" collection="deps" item="dep" open="(" separator=",">
|
|
|
+ #{dep}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="orderNo !=null">
|
|
|
+ and b.order_no = #{orderNo}
|
|
|
+ </if>
|
|
|
+ <if test="userName !=null">
|
|
|
+ and tom.buyer_name like CONCAT('%',#{userName},'%')
|
|
|
+ </if>
|
|
|
+ <if test="depId !=null">
|
|
|
+ and c.order_dep = #{depId}
|
|
|
+ </if>
|
|
|
+ <if test="contractNo !=null">
|
|
|
+ and c.contract_no like CONCAT('%',#{contractNo},'%')
|
|
|
+ </if>
|
|
|
+ <if test="projectName !=null">
|
|
|
+ and b.commodity_name like CONCAT('%',#{projectName},'%')
|
|
|
+ </if>
|
|
|
+ <if test="status !=null">
|
|
|
+ <if test="status==0">
|
|
|
+ and a.`type` =0 and a.status =0
|
|
|
+ </if>
|
|
|
+ <if test="status==1">
|
|
|
+ and a.`type` =1 and a.status =0
|
|
|
+ </if>
|
|
|
+ <if test="status==2">
|
|
|
+ and a.`type` =0 and a.status =1
|
|
|
+ </if>
|
|
|
+ <if test="status==3">
|
|
|
+ and a.`type` =1 and a.status =1
|
|
|
+ </if>
|
|
|
+ <if test="status==4">
|
|
|
+ and a.status=2
|
|
|
+ </if>
|
|
|
+ </if>
|
|
|
+ <if test="receiverId !=null">
|
|
|
+ and b.task_receiver = #{receiverId}
|
|
|
+ </if>
|
|
|
+ <if test="startTime !=null and endTime !=null">
|
|
|
+ and a.create_time BETWEEN #{startTime} and #{endTime}
|
|
|
+ </if>
|
|
|
+ order by a.create_time desc
|
|
|
+ <if test="page_sql!=null">
|
|
|
+ ${page_sql}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
|
|
|
+ <select id="selectProjectSotpCount" resultType="java.lang.Integer">
|
|
|
+ select count(*)
|
|
|
+ from task_sopt a left join t_order_task b on a.tid=b.id
|
|
|
+ left join t_order_new c on b.order_no =c.order_no
|
|
|
+ left join t_order_mid tom on c.order_no =tom.order_no
|
|
|
+ where 1=1
|
|
|
+ <if test="shiro ==1">
|
|
|
+ and c.salesman_id =#{aid}
|
|
|
+ </if>
|
|
|
+ <if test="shiro ==2">
|
|
|
+ and c.order_dep in
|
|
|
+ <foreach close=")" collection="deps" item="dep" open="(" separator=",">
|
|
|
+ #{dep}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="orderNo !=null">
|
|
|
+ and b.order_no = #{orderNo}
|
|
|
+ </if>
|
|
|
+ <if test="userName !=null">
|
|
|
+ and tom.buyer_name like CONCAT('%',#{userName},'%')
|
|
|
+ </if>
|
|
|
+ <if test="depId !=null">
|
|
|
+ and c.order_dep = #{depId}
|
|
|
+ </if>
|
|
|
+ <if test="contractNo !=null">
|
|
|
+ and c.contract_no like CONCAT('%',#{contractNo},'%')
|
|
|
+ </if>
|
|
|
+ <if test="projectName !=null">
|
|
|
+ and b.commodity_name like CONCAT('%',#{projectName},'%')
|
|
|
+ </if>
|
|
|
+ <if test="status !=null">
|
|
|
+ <if test="status==0">
|
|
|
+ and a.`type` =0 and a.status =0
|
|
|
+ </if>
|
|
|
+ <if test="status==1">
|
|
|
+ and a.`type` =1 and a.status =0
|
|
|
+ </if>
|
|
|
+ <if test="status==2">
|
|
|
+ and a.`type` =0 and a.status =1
|
|
|
+ </if>
|
|
|
+ <if test="status==3">
|
|
|
+ and a.`type` =1 and a.status =1
|
|
|
+ </if>
|
|
|
+ <if test="status==4">
|
|
|
+ and a.status=2
|
|
|
+ </if>
|
|
|
+ </if>
|
|
|
+ <if test="receiverId !=null">
|
|
|
+ and b.task_receiver = #{receiverId}
|
|
|
+ </if>
|
|
|
+ <if test="startTime !=null and endTime !=null">
|
|
|
+ and a.create_time BETWEEN #{startTime} and #{endTime}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
|
|
|
</mapper>
|