|
@@ -101,7 +101,7 @@
|
|
|
</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 id="findLiftListByProjectId" resultType="cn.com.ty.lift.business.library.dao.entity.model.LiftResponse" parameterType="cn.com.ty.lift.business.library.dao.entity.model.ProjectLiftRequest">
|
|
|
SELECT
|
|
|
l.id AS id,
|
|
|
l.lift_code AS liftCode,
|
|
@@ -114,16 +114,44 @@
|
|
|
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 l ON plr.lift_id = l.id
|
|
|
LEFT JOIN lift_brand lb ON l.lift_brand = lb.code
|
|
|
LEFT JOIN user_info ui ON plr.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.companyId!=null and request.companyId!=''">
|
|
|
+ AND plr.company_id = #{request.companyId,jdbcType=BIGINT}
|
|
|
+ </if>
|
|
|
<if test="request.projectId!=null and request.projectId!=''">
|
|
|
AND plr.project_id = #{request.projectId,jdbcType=BIGINT}
|
|
|
</if>
|
|
|
</select>
|
|
|
|
|
|
+ <!-- 选择电梯 -->
|
|
|
+ <select id="chooseLiftList" resultType="cn.com.ty.lift.business.library.dao.entity.model.LiftResponse" parameterType="cn.com.ty.lift.business.library.dao.entity.model.LiftChooseRequest">
|
|
|
+ SELECT
|
|
|
+ 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,
|
|
|
+ l.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 plr.lift_id = l.id
|
|
|
+ LEFT JOIN lift_brand lb ON l.lift_brand = lb.code
|
|
|
+ LEFT JOIN user_info ui ON plr.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
|
|
|
+ AND pclr.lift_company_status != '1'
|
|
|
+ AND l.lift_status = '2'
|
|
|
+ <if test="request.companyId!=null and request.companyId!=''">
|
|
|
+ AND plr.company_id != #{request.companyId,jdbcType=BIGINT}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
<!--根据注册代码查询电梯是否存在,返回电梯id -->
|
|
|
<select id="findLiftExist" parameterType="java.lang.String" resultType="java.lang.Long">
|
|
|
SELECT id FROM lift
|