|
@@ -81,7 +81,7 @@
|
|
|
LEFT JOIN project_lift_relevance plr ON pclr.mt_company_id = plr.mt_company_id and pclr.lift_id = plr.lift_id
|
|
|
LEFT JOIN project p ON pclr.mt_company_id = p.mt_company_id and plr.project_id = p.id
|
|
|
LEFT JOIN lift_brand lb ON l.lift_brand = lb.code
|
|
|
- WHERE plr.delete_flag = '0'
|
|
|
+ WHERE 1=1
|
|
|
<if test="request.mtCompanyId!=null and request.mtCompanyId!=''">
|
|
|
AND pclr.mt_company_id = #{request.mtCompanyId,jdbcType=BIGINT}
|
|
|
</if>
|
|
@@ -100,6 +100,12 @@
|
|
|
<if test="request.registrationCode!=null and request.registrationCode!=''">
|
|
|
AND l.registration_code LIKE #{request.registrationCode,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
+ <if test="request.regionId!=null and request.regionId!=''">
|
|
|
+ AND p.region_id = #{request.regionId,jdbcType=BIGINT}
|
|
|
+ </if>
|
|
|
+ <if test="request.projectId!=null and request.projectId!=''">
|
|
|
+ AND p.id = #{request.projectId,jdbcType=BIGINT}
|
|
|
+ </if>
|
|
|
</select>
|
|
|
|
|
|
<!-- 查询项目下电梯列表 -->
|
|
@@ -126,7 +132,7 @@
|
|
|
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 plr.delete_flag = '0'
|
|
|
+ WHERE 1=1
|
|
|
<if test="request.mtCompanyId!=null and request.mtCompanyId!=''">
|
|
|
AND plr.mt_company_id = #{request.mtCompanyId,jdbcType=BIGINT}
|
|
|
</if>
|
|
@@ -138,29 +144,29 @@
|
|
|
<!-- 选择电梯 -->
|
|
|
<select id="chooseLiftList" resultType="cn.com.ty.lift.business.library.dao.entity.model.response.LiftResponse"
|
|
|
parameterType="cn.com.ty.lift.business.library.dao.entity.model.request.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,
|
|
|
- pclr.id AS companyRelevanceId,
|
|
|
- ui.name AS workerName,
|
|
|
- plr.worker_id AS workerId
|
|
|
+ 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,
|
|
|
+ pclr.id AS companyRelevanceId,
|
|
|
+ ui.name AS workerName,
|
|
|
+ plr.worker_id AS workerId
|
|
|
FROM platform_company_lift_relevance pclr
|
|
|
- LEFT JOIN lift l ON pclr.lift_id = l.id
|
|
|
- LEFT JOIN lift_brand lb ON l.lift_brand = lb.code
|
|
|
- LEFT JOIN project_lift_relevance plr ON pclr.lift_id = plr.lift_id
|
|
|
+ LEFT JOIN lift l ON pclr.lift_id = l.id
|
|
|
+ LEFT JOIN lift_brand lb ON l.lift_brand = lb.code
|
|
|
+ LEFT JOIN project_lift_relevance plr ON pclr.lift_id = plr.lift_id
|
|
|
AND pclr.id = plr.relevance_id
|
|
|
- LEFT JOIN user_info ui ON plr.worker_id = ui.user_id
|
|
|
+ LEFT JOIN user_info ui ON plr.worker_id = ui.user_id
|
|
|
WHERE pclr.lift_company_status != '1'
|
|
|
- AND plr.delete_flag = '0'
|
|
|
+ AND l.lift_status = '2'
|
|
|
<if test="request.mtCompanyId!=null and request.mtCompanyId!=''">
|
|
|
AND pclr.mt_company_id = #{request.mtCompanyId,jdbcType=BIGINT}
|
|
|
</if>
|
|
|
+ AND plr.project_id IS NULL
|
|
|
</select>
|
|
|
|
|
|
<!--根据公司和项目查询电梯 -->
|
|
@@ -188,7 +194,7 @@
|
|
|
LEFT JOIN project_lift_relevance plr ON l.id = plr.lift_id
|
|
|
LEFT JOIN user_info ui ON plr.worker_id = ui.user_id
|
|
|
WHERE l.id = #{id,jdbcType=BIGINT}
|
|
|
- and plr.project_id = #{projectId};
|
|
|
+ AND plr.project_id = #{projectId}
|
|
|
</select>
|
|
|
|
|
|
<select id="queryLiftListByIdList" parameterType="java.util.List"
|