|
@@ -60,57 +60,62 @@
|
|
|
<!-- 根据区域,项目,电梯号,电梯品牌,电梯类型,维保工查询电梯列表信息-->
|
|
|
<select id="findByCondition" resultType="cn.com.ty.lift.business.library.dao.entity.model.LiftResponse" parameterType="cn.com.ty.lift.business.library.dao.entity.model.LiftRequest" >
|
|
|
SELECT
|
|
|
- l.lift_code as liftCode,
|
|
|
- l.registration_code as registrationCode,
|
|
|
- lb.name as liftBrand,
|
|
|
- l.lift_type as liftType,
|
|
|
- l.device_position as devicePosition,
|
|
|
- pclr.lift_company_status as liftStatus,
|
|
|
- le.first_time as firstMaintenanceTime
|
|
|
+ l.id AS id,
|
|
|
+ l.lift_code AS liftCode,
|
|
|
+ l.registration_code AS registrationCode,
|
|
|
+ l.lift_type AS liftType,
|
|
|
+ l.device_position AS devicePosition,
|
|
|
+ lb.name AS liftBrand,
|
|
|
+ pclr.lift_company_status AS liftStatus,
|
|
|
+ le.first_time AS firstMaintenanceTime,
|
|
|
+ p.project_name AS projectName
|
|
|
FROM platform_company_lift_relevance pclr
|
|
|
- LEFT JOIN lift l on l.id = pclr.lift_id
|
|
|
- LEFT JOIN lift_brand lb on l.lift_brand = lb.code
|
|
|
- LEFT JOIN lift_extension le on le.id = pclr.lift_id and le.mt_company_id = pclr.company_id
|
|
|
- where 1=1
|
|
|
+ LEFT JOIN lift l ON l.id = pclr.lift_id
|
|
|
+ LEFT JOIN project p ON pclr.company_id = p.mt_company_id
|
|
|
+ LEFT JOIN lift_brand lb ON l.lift_brand = lb.code
|
|
|
+ LEFT JOIN lift_extension le ON le.id = pclr.lift_id AND le.mt_company_id = pclr.company_id
|
|
|
+ WHERE 1=1
|
|
|
<if test="request.companyId!=null and request.companyId!=''">
|
|
|
- and pclr.company_id = #{request.companyId,jdbcType=BIGINT}
|
|
|
+ AND pclr.company_id = #{request.companyId,jdbcType=BIGINT}
|
|
|
</if>
|
|
|
- <if test="request.liftStatus == 1">
|
|
|
- and pclr.lift_company_status != 1
|
|
|
+ <if test="request.liftStatus != null and request.liftStatus != '' and request.liftStatus == 1">
|
|
|
+ AND pclr.lift_company_status != 1
|
|
|
</if>
|
|
|
- <if test="request.liftStatus == 0">
|
|
|
- and pclr.lift_company_status = 1
|
|
|
+ <if test="request.liftStatus != null and request.liftStatus != '' and request.liftStatus == 0">
|
|
|
+ AND pclr.lift_company_status = 1
|
|
|
</if>
|
|
|
<if test="request.liftType!=null and request.liftType!=''">
|
|
|
- and l.lift_type = #{request.liftType,jdbcType=VARCHAR}
|
|
|
+ AND l.lift_type = #{request.liftType,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
<if test="request.liftBrand!=null and request.liftBrand!=''">
|
|
|
- and lb.code = #{request.liftBrand,jdbcType=VARCHAR}
|
|
|
+ AND lb.code = #{request.liftBrand,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
<if test="request.registrationCode!=null and request.registrationCode!=''">
|
|
|
- and l.registration_code like #{request.registrationCode,jdbcType=VARCHAR}
|
|
|
+ AND l.registration_code LIKE #{request.registrationCode,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
</select>
|
|
|
|
|
|
<!-- 查询项目下电梯列表 -->
|
|
|
<select id="findLiftListByProjectId" resultType="cn.com.ty.lift.business.library.dao.entity.model.LiftResponse" parameterType="cn.com.ty.lift.business.library.dao.entity.model.LiftRequest">
|
|
|
SELECT
|
|
|
- l.id as liftId,
|
|
|
- l.lift_code as liftCode,
|
|
|
- l.registration_code as registrationCode,
|
|
|
- l.lift_type as liftType,
|
|
|
- l.device_position as devicePosition,
|
|
|
- lb.name as liftBrand,
|
|
|
- le.annual_inspection_date as annualInspectionDate,
|
|
|
- pclr.lift_company_status as liftStatus
|
|
|
+ l.id AS id,
|
|
|
+ l.lift_code AS liftCode,
|
|
|
+ l.registration_code AS registrationCode,
|
|
|
+ l.lift_type AS liftType,
|
|
|
+ l.device_position AS devicePosition,
|
|
|
+ lb.name AS liftBrand,
|
|
|
+ le.annual_inspection_date AS annualInspectionDate,
|
|
|
+ pclr.lift_company_status AS liftStatus,
|
|
|
+ ui.name AS workerName
|
|
|
FROM project_lift_relevance plr
|
|
|
LEFT JOIN lift l ON l.id = plr.lift_id
|
|
|
LEFT JOIN lift_brand lb ON l.lift_brand = lb.code
|
|
|
- LEFT JOIN lift_extension le ON le.id = plr.lift_id and le.mt_company_id = plr.company_id
|
|
|
- LEFT JOIN platform_company_lift_relevance pclr on plr.lift_id = pclr.lift_id and pclr.id = plr.relevance_id
|
|
|
- where 1=1
|
|
|
+ LEFT JOIN lift_extension le ON le.id = plr.lift_id AND le.mt_company_id = plr.company_id
|
|
|
+ LEFT JOIN user_info ui ON le.worker_id = ui.user_id
|
|
|
+ LEFT JOIN platform_company_lift_relevance pclr ON plr.lift_id = pclr.lift_id AND pclr.id = plr.relevance_id
|
|
|
+ WHERE 1=1
|
|
|
<if test="request.projectId!=null and request.projectId!=''">
|
|
|
- and plr.project_id = #{request.projectId,jdbcType=BIGINT}
|
|
|
+ AND plr.project_id = #{request.projectId,jdbcType=BIGINT}
|
|
|
</if>
|
|
|
</select>
|
|
|
|