123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108 |
- <?xml version="1.0" encoding="UTF-8" ?>
- <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
- <mapper namespace="cn.com.ty.lift.business.emergency.mapper.EmergencyRepairMapper" >
- <resultMap id="BaseResultMap" type="cn.com.ty.lift.business.emergency.dto.RepairResponse" >
- <id column="id" property="id" jdbcType="BIGINT" />
- <result column="mt_company_id" property="mtCompanyId" jdbcType="BIGINT" />
- <result column="lift_id" property="liftId" jdbcType="BIGINT" />
- <result column="is_trapped" property="isTrapped" jdbcType="TINYINT" />
- <result column="is_critical" property="isCritical" jdbcType="TINYINT" />
- <result column="source" property="source" jdbcType="TINYINT" />
- <result column="caller_id" property="callerId" jdbcType="BIGINT" />
- <result column="caller_tel" property="callerTel" jdbcType="CHAR" />
- <result column="caller_date" property="callerDate" jdbcType="TIMESTAMP" />
- <result column="stop_date" property="stopDate" jdbcType="TIMESTAMP" />
- <result column="recovery_date" property="recoveryDate" jdbcType="TIMESTAMP" />
- <result column="charge" property="charge" jdbcType="VARCHAR" />
- <result column="worker_id" property="workerId" jdbcType="BIGINT" />
- <result column="worker_tel" property="workerTel" jdbcType="CHAR" />
- <result column="position" property="position" jdbcType="VARCHAR" />
- <result column="status" property="status" jdbcType="TINYINT" />
- <result column="creator_id" property="creatorId" jdbcType="BIGINT" />
- <result column="create_date" property="createDate" jdbcType="TIMESTAMP" />
- <result column="repair_reason" property="repairReason" jdbcType="TINYINT" />
- <result column="parts_cost" property="partsCost" jdbcType="DECIMAL" />
- <result column="safety_confirm" property="safetyConfirm" jdbcType="VARCHAR" />
- <result column="read_time" property="readTime" jdbcType="TIMESTAMP" />
- <result column="worker_id1" property="workerId1" jdbcType="BIGINT" />
- <result column="wl_floor" property="wlFloor" jdbcType="INTEGER" />
- <result column="wl_liftdoor" property="wlLiftdoor" jdbcType="TINYINT" />
- <result column="wl_fault" property="wlFault" jdbcType="VARCHAR" />
- <result column="wl_fault_reason" property="wlFaultReason" jdbcType="VARCHAR" />
- <result column="wl_fault_handle" property="wlFaultHandle" jdbcType="VARCHAR" />
- <result column="wl_run_direction" property="wlRunDirection" jdbcType="TINYINT" />
- <result column="cost_total" property="costTotal" jdbcType="DECIMAL" />
- <result column="project_id" property="projectId" jdbcType="INTEGER" />
- <result column="caller_fault_description" property="callerFaultDescription" jdbcType="LONGVARCHAR" />
- <result column="sparepart" property="sparepart" jdbcType="LONGVARCHAR" />
- <result column="worker_fault_description" property="workerFaultDescription" jdbcType="LONGVARCHAR" />
- <result column="field_description" property="fieldDescription" jdbcType="LONGVARCHAR" />
- <result column="repair_procedure" property="repairProcedure" jdbcType="LONGVARCHAR" />
- <result column="project_name" property="projectName" jdbcType="VARCHAR" />
- <result column="area_name" property="areaName" jdbcType="VARCHAR" />
- <result column="registration_code" property="registrationCode" jdbcType="VARCHAR" />
- <result column="device_position" property="devicePosition" jdbcType="VARCHAR" />
- <result column="call_name" property="callName" jdbcType="VARCHAR" />
- <result column="lift_company_status" property="liftCompanyStatus" jdbcType="VARCHAR" />
- </resultMap>
- <!--查询急修中-->
- <select id="listByRepairing" resultMap="BaseResultMap" parameterType="cn.com.ty.lift.business.emergency.dto.RepairRequest">
- SELECT
- er.*,
- ui.`name` AS call_name,
- li.registration_code,
- li.device_position,
- pr.project_name,
- pclr.lift_company_status
- FROM
- emergency_repair er
- LEFT JOIN user_info ui ON ui.user_id = er.caller_id
- LEFT JOIN lift li ON li.id = er.lift_id
- LEFT JOIN project pr ON pr.id = er.project_id
- LEFT JOIN platform_company_lift_relevance pclr ON pclr.lift_id = li.id
- WHERE
- er.`status` <![CDATA[ <> ]]> 4
- </select>
- <!--根据条件查询急修记录-->
- <select id="listByCondition" resultMap="BaseResultMap" parameterType="cn.com.ty.lift.business.emergency.dto.RepairRequest" >
- SELECT
- er.*,
- li.registration_code AS registration_code
- pr.project_name,
- re.area_name
- FROM
- emergency_repair er
- LEFT JOIN project pr ON er.project_id = pr.id
- LEFT JOIN region re ON pr.region_id = re.id
- LEFT JOIN lift li ON er.lift_id = li.id
- WHERE 1 = 1
- <if test="condition.projectId != null and condition.projectId > 0">
- AND pr.id = #{condition.projectId}
- </if>
- <if test="condition.regionId != null and condition.regionId > 0">
- AND pr.region_id = #{condition.regionId}
- </if>
- <if test="condition.workerId != null and condition.workerId > 0">
- AND er.worker_id = #{condition.workerId}
- </if>
- <if test="condition.repairBegin != null">
- AND er.caller_date > #{condition.repairBegin}
- </if>
- <if test="condition.repairEnd != null">
- AND er.caller_date < #{condition.repairEnd}
- </if>
- <if test="condition.status != null">
- AND er.status = #{condition.status}
- </if>
- <if test="condition.source != null">
- AND er.source = #{condition.source}
- </if>
- <if test="condition.info != null and condition.info != ''">
- AND li.registration_code LIKE #{condition.info}
- </if>
- </select>
- </mapper>
|