|
@@ -18,6 +18,7 @@
|
|
|
<result column="contractCode" property="contractCode"/>
|
|
|
<result column="deviceName" property="deviceName"/>
|
|
|
<result column="followUpPerson" property="followUpPerson"/>
|
|
|
+ <result column="followUpPersonName" property="followUpPersonName"/>
|
|
|
<result column="followUpPersonPhone" property="followUpPersonPhone"/>
|
|
|
<result column="workWay" property="workWay"/>
|
|
|
<result column="compendious" property="compendious"/>
|
|
@@ -32,9 +33,9 @@
|
|
|
|
|
|
<insert id="insert" parameterType="com.bosshand.virgo.api.model.WorkOrder" useGeneratedKeys="true" keyProperty="id">
|
|
|
INSERT INTO work_order(`projectId`, `projectItemTargetRoomIds`, `tenantType`, `merchantId`, `clientId`, `userId`, `contractId`, `contractCode`, `deviceName`, `followUpPerson`,
|
|
|
- `followUpPersonPhone`, `workWay`, `compendious`, `picture`, `date`, `name`, `type`, `status`, `attachment`, `data`)
|
|
|
+ `workWay`, `compendious`, `picture`, `date`, `name`, `type`, `status`, `attachment`, `data`)
|
|
|
VALUES (#{projectId}, #{projectItemTargetRoomIds}, #{tenantType}, #{merchantId}, #{clientId}, #{userId}, #{contractId}, #{contractCode}, #{deviceName}, #{followUpPerson},
|
|
|
- #{followUpPersonPhone}, #{workWay}, #{compendious}, #{picture}, now(), #{name}, #{type}, #{status}, #{attachment}, #{data})
|
|
|
+ #{workWay}, #{compendious}, #{picture}, now(), #{name}, #{type}, #{status}, #{attachment}, #{data})
|
|
|
</insert>
|
|
|
|
|
|
<delete id="delete">
|
|
@@ -53,8 +54,7 @@
|
|
|
<if test="contractId!=0">contractId=#{contractId},</if>
|
|
|
<if test="contractCode!=null">contractCode=#{contractCode},</if>
|
|
|
<if test="deviceName!=null">deviceName=#{deviceName},</if>
|
|
|
- <if test="followUpPerson!=null">followUpPerson=#{followUpPerson},</if>
|
|
|
- <if test="followUpPersonPhone!=null">followUpPersonPhone=#{followUpPersonPhone},</if>
|
|
|
+ <if test="followUpPerson!=0">followUpPerson=#{followUpPerson},</if>
|
|
|
<if test="workWay!=null">workWay=#{workWay},</if>
|
|
|
<if test="compendious!=null">compendious=#{compendious},</if>
|
|
|
<if test="picture!=null">picture=#{picture},</if>
|
|
@@ -68,7 +68,8 @@
|
|
|
</update>
|
|
|
|
|
|
<sql id="query">
|
|
|
- SELECT a.*, c.name as merchantName, d.name as clientName FROM work_order a
|
|
|
+ SELECT a.*, b.name as followUpPersonName, b.phone as followUpPersonPhone, c.name as merchantName, d.name as clientName FROM work_order a
|
|
|
+ LEFT JOIN mgr_user b ON a.followUpPerson = b.id
|
|
|
LEFT JOIN merchant c ON a.merchantId = c.id
|
|
|
LEFT JOIN mgr_client d ON a.clientId = d.id
|
|
|
</sql>
|
|
@@ -90,8 +91,7 @@
|
|
|
<if test="contractId!=0">and contractId=#{contractId}</if>
|
|
|
<if test="contractCode!=null">and contractCode=#{contractCode}</if>
|
|
|
<if test="deviceName!=null">and deviceName=#{deviceName}</if>
|
|
|
- <if test="followUpPerson!=null">and followUpPerson=#{followUpPerson}</if>
|
|
|
- <if test="followUpPersonPhone!=null">and followUpPersonPhone=#{followUpPersonPhone}</if>
|
|
|
+ <if test="followUpPerson!=0">and followUpPerson=#{followUpPerson}</if>
|
|
|
<if test="workWay!=null">and workWay=#{workWay}</if>
|
|
|
<if test="compendious!=null">and compendious=#{compendious}</if>
|
|
|
<if test="picture!=null">and picture=#{picture}</if>
|
|
@@ -120,8 +120,7 @@
|
|
|
<if test="p.contractId!=0">and a.contractId=#{p.contractId}</if>
|
|
|
<if test="p.contractCode!=null">and a.contractCode=#{p.contractCode}</if>
|
|
|
<if test="p.deviceName!=null">and a.deviceName=#{p.deviceName}</if>
|
|
|
- <if test="p.followUpPerson!=null">and a.followUpPerson=#{p.followUpPerson}</if>
|
|
|
- <if test="p.followUpPersonPhone!=null">and a.followUpPersonPhone=#{p.followUpPersonPhone}</if>
|
|
|
+ <if test="p.followUpPerson!=0">and a.followUpPerson=#{p.followUpPerson}</if>
|
|
|
<if test="p.workWay!=null">and a.workWay=#{p.workWay}</if>
|
|
|
<if test="p.compendious!=null">and a.compendious=#{p.compendious}</if>
|
|
|
<if test="p.picture!=null">and a.picture=#{p.picture}</if>
|