|
|
@@ -783,7 +783,10 @@ from
|
|
|
e.nickname as buyerName,
|
|
|
f.name as taskReceiverName
|
|
|
from
|
|
|
- contract_task a left join business_project b on
|
|
|
+ (select *
|
|
|
+ from contract_task_log
|
|
|
+ where task_receiver= #{taskReceiver,jdbcType=VARCHAR}) x left join contract_task a on
|
|
|
+ x.contract_task_id=a.id left join business_project b on
|
|
|
a.commodity_id = b.id left join business_varieties c on
|
|
|
b.cid = c.id left join contract d on
|
|
|
a.contract_id = d.id left join user e on
|
|
|
@@ -830,7 +833,10 @@ from
|
|
|
select
|
|
|
count(0)
|
|
|
from
|
|
|
- contract_task a left join business_project b on
|
|
|
+ (select *
|
|
|
+ from contract_task_log
|
|
|
+ where task_receiver= #{taskReceiver,jdbcType=VARCHAR}) x left join contract_task a on
|
|
|
+ x.contract_task_id=a.id left join business_project b on
|
|
|
a.commodity_id = b.id left join business_varieties c on
|
|
|
b.cid = c.id left join contract d on
|
|
|
a.contract_id = d.id left join user e on
|
|
|
@@ -868,4 +874,128 @@ from
|
|
|
and c.id = #{categoryId,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
</select>
|
|
|
+
|
|
|
+
|
|
|
+ <select id="salesmanListProjectByPage" resultType="com.goafanti.techproject.bo.ProjectListBo">
|
|
|
+ select
|
|
|
+ a.id,
|
|
|
+ a.serial_number as serialNumber,
|
|
|
+ date_format(a.sign_date,'%Y-%m-%d %H:%i:%S') as signDate,
|
|
|
+ date_format(a.create_time,'%Y-%m-%d %H:%i:%S') as projectTime,
|
|
|
+ a.uid,
|
|
|
+ a.status as projectStatus,
|
|
|
+ a.task_distribution as taskDistribution,
|
|
|
+ a.deleted_sign as deletedSign,
|
|
|
+ a.order_no as orderNo,
|
|
|
+ b.nickname as buyerName,
|
|
|
+ b.type as buyerType,
|
|
|
+ f.cname as projectType,
|
|
|
+ c.create_time as orderTime,
|
|
|
+ c.order_status as orderStatus,
|
|
|
+ c.liquidation_status as liquidationStatus,
|
|
|
+ c.approval,
|
|
|
+ d.name as salesmanName,
|
|
|
+ e.name as departmentName,
|
|
|
+ g.name as principalName
|
|
|
+ from
|
|
|
+ contract a left join user b on
|
|
|
+ a.uid = b.id left join t_order c on
|
|
|
+ a.order_no = c.order_no left join admin d on
|
|
|
+ c.salesman_id = d.id left join department_management e on
|
|
|
+ d.department_id = e.id left join business_varieties f on
|
|
|
+ a.type = f.id left join admin g on
|
|
|
+ a.principal = g.id
|
|
|
+ where 1=1
|
|
|
+ and c.salesman_id= #{salesmanId,jdbcType=VARCHAR}
|
|
|
+ <if test="deletedSign != null">
|
|
|
+ and a.deleted_sign = #{deletedSign,jdbcType=INTEGER}
|
|
|
+ </if>
|
|
|
+ <if test="orderNo != null and orderNo != ''">
|
|
|
+ and a.order_no = #{orderNo,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test="serialNumber != null and serialNumber != ''">
|
|
|
+ and a.serial_number = #{serialNumber,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test="setUpStartDate != null and setUpStartDate != ''">
|
|
|
+ and a.create_time > #{setUpStartDate,jdbcType=TIMESTAMP}
|
|
|
+ </if>
|
|
|
+ <if test="setUpEndDate != null and setUpEndDate != ''">
|
|
|
+ and a.create_time < #{setUpEndDate,jdbcType=TIMESTAMP}
|
|
|
+ </if>
|
|
|
+ <if test="taskDistribution != null">
|
|
|
+ and a.task_distribution = #{taskDistribution,jdbcType=INTEGER}
|
|
|
+ </if>
|
|
|
+ <if test="buyerName != null and buyerName != ''">
|
|
|
+ and b.nickname like concat('%',#{buyerName,jdbcType=VARCHAR},'%')
|
|
|
+ </if>
|
|
|
+ <if test="salesmanName != null and salesmanName !=''">
|
|
|
+ and d.name = #{salesmanName,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test="depId != null and depId != ''">
|
|
|
+ and d.department_id = #{depId,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test="orderStartDate != null and orderStartDate != ''">
|
|
|
+ and c.create_time > #{orderStartDate,jdbcType=TIMESTAMP}
|
|
|
+ </if>
|
|
|
+ <if test="orderEndDate != null and orderEndDate != ''">
|
|
|
+ and c.create_time < #{orderEndDate,jdbcType=TIMESTAMP}
|
|
|
+ </if>
|
|
|
+ <if test="principalName != null and principalName != ''">
|
|
|
+ and g.name = #{principalName,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ order by a.create_time desc
|
|
|
+ <if test="page_sql != null">
|
|
|
+ ${page_sql}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+ <select id="salesmanListProjectCount" resultType="java.lang.Integer">
|
|
|
+ select
|
|
|
+ count(0)
|
|
|
+ from
|
|
|
+ contract a left join user b on
|
|
|
+ a.uid = b.id left join t_order c on
|
|
|
+ a.order_no = c.order_no left join admin d on
|
|
|
+ c.salesman_id = d.id left join department_management e on
|
|
|
+ d.department_id = e.id left join business_varieties f on
|
|
|
+ a.type = f.id left join admin g on
|
|
|
+ a.principal = g.id
|
|
|
+ where 1=1
|
|
|
+ and c.salesman_id= #{salesmanId,jdbcType=VARCHAR}
|
|
|
+ <if test="deletedSign != null">
|
|
|
+ and a.deleted_sign = #{deletedSign,jdbcType=INTEGER}
|
|
|
+ </if>
|
|
|
+ <if test="orderNo != null and orderNo != ''">
|
|
|
+ and a.order_no = #{orderNo,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test="serialNumber != null and serialNumber != ''">
|
|
|
+ and a.serial_number = #{serialNumber,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test="setUpStartDate != null and setUpStartDate != ''">
|
|
|
+ and a.create_time > #{setUpStartDate,jdbcType=TIMESTAMP}
|
|
|
+ </if>
|
|
|
+ <if test="setUpEndDate != null and setUpEndDate != ''">
|
|
|
+ and a.create_time < #{setUpEndDate,jdbcType=TIMESTAMP}
|
|
|
+ </if>
|
|
|
+ <if test="taskDistribution != null">
|
|
|
+ and a.task_distribution = #{taskDistribution,jdbcType=INTEGER}
|
|
|
+ </if>
|
|
|
+ <if test="buyerName != null and buyerName != ''">
|
|
|
+ and b.nickname like concat('%',#{buyerName,jdbcType=VARCHAR},'%')
|
|
|
+ </if>
|
|
|
+ <if test="salesmanName != null and salesmanName !=''">
|
|
|
+ and d.name = #{salesmanName,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test="depId != null and depId != ''">
|
|
|
+ and d.department_id = #{depId,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test="orderStartDate != null and orderStartDate != ''">
|
|
|
+ and c.create_time > #{orderStartDate,jdbcType=TIMESTAMP}
|
|
|
+ </if>
|
|
|
+ <if test="orderEndDate != null and orderEndDate != ''">
|
|
|
+ and c.create_time < #{orderEndDate,jdbcType=TIMESTAMP}
|
|
|
+ </if>
|
|
|
+ <if test="principalName != null and principalName != ''">
|
|
|
+ and g.name = #{principalName,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
</mapper>
|