|
|
@@ -1352,4 +1352,96 @@
|
|
|
where
|
|
|
a.bill_no = #{billNo,jdbcType=VARCHAR}
|
|
|
</select>
|
|
|
+
|
|
|
+ <select id="selectSetUpProjectByPage" resultType="com.goafanti.order.bo.OrderListBo">
|
|
|
+ select
|
|
|
+ a.order_no as orderNo,
|
|
|
+ a.order_type as orderType,
|
|
|
+ date_format(a.create_time,'%Y-%m-%d %H:%i:%S') as createTime,
|
|
|
+ a.order_status as orderStatus,
|
|
|
+ a.liquidation_status as liquidationStatus,
|
|
|
+ a.approval,
|
|
|
+ a.order_channel as orderChannel,
|
|
|
+ b.nickname as buyerName,
|
|
|
+ c.name as salesmanName,
|
|
|
+ d.name as financeName,
|
|
|
+ e.name as technicianName,
|
|
|
+ f.departmentName
|
|
|
+ from
|
|
|
+ t_order a left join user b on
|
|
|
+ a.buyer_id = b.id left join admin c on
|
|
|
+ a.salesman_id = c.id left join admin d on
|
|
|
+ a.finance_id = d.id left join admin e on
|
|
|
+ a.technician_id = e.id left join department_management f on
|
|
|
+ d.department_id = f.id
|
|
|
+ where a.type = 0 and a.order_status = 3
|
|
|
+ and (a.liquidation_status = 1 or a.liquidation_status = 2 or a.approval = 2) <!-- 已首付 or 已付清 or 已特批 -->
|
|
|
+ <if test="salesmanId != null">
|
|
|
+ and a.salesman_id = #{a.salesmanId,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test="financeId != null">
|
|
|
+ and a.finance_id = #{financeId,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test="technicianId != null">
|
|
|
+ and a.technician_id = #{technicianId,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test="startDate != null">
|
|
|
+ and a.create_time > #{a.startDate,jdbcType=TIMESTAMP}
|
|
|
+ </if>
|
|
|
+ <if test="endDate != null">
|
|
|
+ and a.create_time < #{a.endDate,jdbcType=TIMESTAMP}
|
|
|
+ </if>
|
|
|
+ <if test="buyerName != null and buyerName != ''">
|
|
|
+ and b.nickname = #{buyerName,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test="approval != null">
|
|
|
+ and a.approval = #{approval,jdbcType=INTEGER}
|
|
|
+ </if>
|
|
|
+ <if test="depId != null and depId != ''">
|
|
|
+ and f.id = #{depId,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test="page_sql != null">
|
|
|
+ ${page_sql}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+ <select id="selectSetUpProjectCount" resultType="java.lang.Integer">
|
|
|
+ select
|
|
|
+ count(0)
|
|
|
+ from
|
|
|
+ t_order a left join user b on
|
|
|
+ a.buyer_id = b.id left join admin c on
|
|
|
+ a.salesman_id = c.id left join admin d on
|
|
|
+ a.finance_id = d.id left join admin e on
|
|
|
+ a.technician_id = e.id left join department_management f on
|
|
|
+ d.department_id = f.id
|
|
|
+ where a.type = 0 and a.order_status = 3
|
|
|
+ and (a.liquidation_status = 1 or a.liquidation_status = 2 or a.approval = 2) <!-- 已首付 or 已付清 or 已特批 -->
|
|
|
+ <if test="salesmanId != null">
|
|
|
+ and a.salesman_id = #{a.salesmanId,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test="financeId != null">
|
|
|
+ and a.finance_id = #{financeId,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test="technicianId != null">
|
|
|
+ and a.technician_id = #{technicianId,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test="startDate != null">
|
|
|
+ and a.create_time > #{a.startDate,jdbcType=TIMESTAMP}
|
|
|
+ </if>
|
|
|
+ <if test="endDate != null">
|
|
|
+ and a.create_time < #{a.endDate,jdbcType=TIMESTAMP}
|
|
|
+ </if>
|
|
|
+ <if test="buyerName != null and buyerName != ''">
|
|
|
+ and b.nickname = #{buyerName,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test="approval != null">
|
|
|
+ and a.approval = #{approval,jdbcType=INTEGER}
|
|
|
+ </if>
|
|
|
+ <if test="depId != null and depId != ''">
|
|
|
+ and f.id = #{depId,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test="page_sql != null">
|
|
|
+ ${page_sql}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
</mapper>
|