|
|
@@ -575,16 +575,19 @@
|
|
|
a.order_no as orderNo,
|
|
|
a.type as projectType,
|
|
|
b.nickname as buyerName,
|
|
|
+ b.type as buyerType,
|
|
|
c.create_time as orderTime,
|
|
|
c.order_status as orderStatus,
|
|
|
c.liquidation_status as liquidationStatus,
|
|
|
c.approval,
|
|
|
- d.name as salesmanName
|
|
|
+ d.name as salesmanName,
|
|
|
+ e.name as departmentName
|
|
|
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
|
|
|
+ c.salesman_id = d.id left join department_management e on
|
|
|
+ d.department_id = e.id
|
|
|
where 1=1
|
|
|
<if test="deleteSign != null">
|
|
|
and a.delete_sign = #{deleteSign,jdbcType=INTEGER}
|
|
|
@@ -592,6 +595,9 @@
|
|
|
<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>
|
|
|
@@ -632,6 +638,9 @@
|
|
|
<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>
|
|
|
@@ -656,27 +665,60 @@
|
|
|
</select>
|
|
|
|
|
|
<select id="selectTechProjectDetail" resultType="com.goafanti.techproject.bo.ProjectDetailBo">
|
|
|
- select
|
|
|
- a.id,
|
|
|
- a.serial_number as serialNumber,
|
|
|
- a.sign_date as signDate,
|
|
|
- a.sign_comment as signComment,
|
|
|
- a.complete_date as completeDate,
|
|
|
- a.complete_comment as completeComment,
|
|
|
- a.uid,
|
|
|
- a.status as projectStatus,
|
|
|
- a.deleted_sign as deleteSign,
|
|
|
- a.order_no as orderNo,
|
|
|
- a.type as projectType,
|
|
|
- b.nickname as buyerName,
|
|
|
- c.name as technicianName,
|
|
|
- d.name as principalName
|
|
|
- from
|
|
|
- contract a left join user b on
|
|
|
- a.uid = b.id left join admin c on
|
|
|
- a.uid = c.id left join admin d on
|
|
|
- a.principal = d.id
|
|
|
- where a.id = #{contractId,jdbcType=VARCHAR}
|
|
|
+ <choose>
|
|
|
+ <when test="buyerType == 0">
|
|
|
+ select
|
|
|
+ a.id,
|
|
|
+ a.serial_number as serialNumber,
|
|
|
+ a.sign_date as signDate,
|
|
|
+ a.sign_comment as signComment,
|
|
|
+ a.complete_date as completeDate,
|
|
|
+ a.complete_comment as completeComment,
|
|
|
+ a.uid,
|
|
|
+ a.status as projectStatus,
|
|
|
+ a.deleted_sign as deleteSign,
|
|
|
+ a.order_no as orderNo,
|
|
|
+ a.type as projectType,
|
|
|
+ b.nickname as buyerName,
|
|
|
+ c.name as technicianName,
|
|
|
+ d.name as principalName,
|
|
|
+ f.name as buyerProvince
|
|
|
+ from
|
|
|
+ contract a left join user b on
|
|
|
+ a.uid = b.id left join admin c on
|
|
|
+ a.uid = c.id left join admin d on
|
|
|
+ a.principal = d.id left join user_identity e on
|
|
|
+ a.uid = e.uid left join district_glossory f on
|
|
|
+ e.province = f.id
|
|
|
+ where a.id = #{contractId,jdbcType=VARCHAR}
|
|
|
+ </when>
|
|
|
+ <when test="buyerType == 1">
|
|
|
+ select
|
|
|
+ a.id,
|
|
|
+ a.serial_number as serialNumber,
|
|
|
+ a.sign_date as signDate,
|
|
|
+ a.sign_comment as signComment,
|
|
|
+ a.complete_date as completeDate,
|
|
|
+ a.complete_comment as completeComment,
|
|
|
+ a.uid,
|
|
|
+ a.status as projectStatus,
|
|
|
+ a.deleted_sign as deleteSign,
|
|
|
+ a.order_no as orderNo,
|
|
|
+ a.type as projectType,
|
|
|
+ b.nickname as buyerName,
|
|
|
+ c.name as technicianName,
|
|
|
+ d.name as principalName,
|
|
|
+ f.name as buyerProvince
|
|
|
+ from
|
|
|
+ contract a left join user b on
|
|
|
+ a.uid = b.id left join admin c on
|
|
|
+ a.uid = c.id left join admin d on
|
|
|
+ a.principal = d.id left join organization_identity e on
|
|
|
+ a.uid = e.uid left join district_glossory f on
|
|
|
+ e.location_province = f.id
|
|
|
+ where a.id = #{contractId,jdbcType=VARCHAR}
|
|
|
+ </when>
|
|
|
+ </choose>
|
|
|
</select>
|
|
|
|
|
|
<select id="selectProjectTask" resultType="com.goafanti.techproject.bo.TaskListBo">
|
|
|
@@ -734,7 +776,7 @@
|
|
|
and d.serial_number = #{projectNo,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
<if test="buyerName != null and buyerName != ''">
|
|
|
- and e.name = #{buyerName,jdbcType=VARCHAR}
|
|
|
+ and e.nickname = #{buyerName,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
<if test="taskReceiverName != null and taskReceiverName != ''">
|
|
|
and f.name = #{taskReceiverName,jdbcType=VARCHAR}
|
|
|
@@ -774,7 +816,7 @@
|
|
|
and d.serial_number = #{projectNo,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
<if test="buyerName != null and buyerName != ''">
|
|
|
- and e.name = #{buyerName,jdbcType=VARCHAR}
|
|
|
+ and e.nickname = #{buyerName,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
<if test="taskReceiverName != null and taskReceiverName != ''">
|
|
|
and f.name = #{taskReceiverName,jdbcType=VARCHAR}
|