|
@@ -94,6 +94,52 @@
|
|
|
</if>)
|
|
|
</select>
|
|
|
|
|
|
+ <!--app端 保养任务列表 (1:保养中、2:已完成) -->
|
|
|
+ <select id="findRecordByWorkerId" resultType="cn.com.ty.lift.business.maintenance.dao.entity.model.response.MaintenanceAppResponse"
|
|
|
+ parameterType="cn.com.ty.lift.business.maintenance.dao.entity.model.request.MaintenanceAppRequest">
|
|
|
+ SELECT p.project_name AS projectName,
|
|
|
+ p.id AS projectId,
|
|
|
+ mr.id AS mtPlanId,
|
|
|
+ mr.id AS recordId,
|
|
|
+ l.id AS liftId,
|
|
|
+ l.coordinate AS coordinate,
|
|
|
+ l.registration_code AS registrationCode,
|
|
|
+ l.use_company_code AS useCompanyCode,
|
|
|
+ l.lift_type AS liftType,
|
|
|
+ l.category AS category,
|
|
|
+ l.lift_code AS liftCode,
|
|
|
+ l.device_position AS devicePosition,
|
|
|
+ ui.name AS workerName,
|
|
|
+ mr.worker_id AS workerId,
|
|
|
+ mr.plan_date AS planDate,
|
|
|
+ mr.type AS maintenanceType,
|
|
|
+ mr.status AS status
|
|
|
+ FROM maintenance_record mr
|
|
|
+ LEFT JOIN project p ON mr.project_id = p.id
|
|
|
+ LEFT JOIN lift l ON mr.lift_id = l.id
|
|
|
+ LEFT JOIN user_info ui ON mr.worker_id = ui.user_id
|
|
|
+ WHERE mr.mt_company_id = #{request.mtCompanyId,jdbcType=BIGINT}
|
|
|
+ <if test="request.workerId!=null and request.workerId!=''">
|
|
|
+ AND mr.worker_id = #{request.workerId,jdbcType=BIGINT}
|
|
|
+ </if>
|
|
|
+ <if test="request.status!=null and request.status!=''">
|
|
|
+ AND mr.status = #{request.status,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="countDoingByUser" resultType="java.lang.Long" parameterType="cn.com.ty.lift.business.common.CommonRequest">
|
|
|
+ SELECT
|
|
|
+ count(1)
|
|
|
+ FROM maintenance_record mr
|
|
|
+ WHERE mr.status = '1'
|
|
|
+ <if test="request.userId != null and request.userId > 0">
|
|
|
+ AND mr.worker_id1 = #{request.userId}
|
|
|
+ </if>
|
|
|
+ <if test="request.mtCompanyId != null and request.mtCompanyId > 0">
|
|
|
+ AND mr.mt_company_id = #{request.mtCompanyId}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
<!--日常保养-保养单:根据条件分页查询-->
|
|
|
<select id="pageRecordByCondition" resultMap="BaseResultMap" parameterType="cn.com.ty.lift.business.maintenance.dao.entity.model.request.MtRecordRequest">
|
|
|
SELECT
|