123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131 |
- <?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.library.dao.mapper.LiftMapper" >
- <resultMap id="BaseResultMap" type="cn.com.ty.lift.business.library.dao.entity.Lift" >
- <id column="id" property="id" jdbcType="BIGINT" />
- <result column="registration_code" property="registrationCode" jdbcType="VARCHAR" />
- <result column="category" property="category" jdbcType="TINYINT" />
- <result column="lift_type" property="liftType" jdbcType="INTEGER" />
- <result column="lift_code" property="liftCode" jdbcType="CHAR" />
- <result column="manufacture_date" property="manufactureDate" jdbcType="DATE" />
- <result column="factory_code" property="factoryCode" jdbcType="VARCHAR" />
- <result column="device_usage" property="deviceUsage" jdbcType="TINYINT" />
- <result column="lift_brand" property="liftBrand" jdbcType="VARCHAR" />
- <result column="install_company" property="installCompany" jdbcType="VARCHAR" />
- <result column="lift_model" property="liftModel" jdbcType="VARCHAR" />
- <result column="pulley_diameter" property="pulleyDiameter" jdbcType="DECIMAL" />
- <result column="rope_num" property="ropeNum" jdbcType="INTEGER" />
- <result column="lock_model" property="lockModel" jdbcType="VARCHAR" />
- <result column="rated_load" property="ratedLoad" jdbcType="INTEGER" />
- <result column="promote_height" property="promoteHeight" jdbcType="DECIMAL" />
- <result column="step_width" property="stepWidth" jdbcType="DECIMAL" />
- <result column="sidewalk_length" property="sidewalkLength" jdbcType="DECIMAL" />
- <result column="tilt_angle" property="tiltAngle" jdbcType="DECIMAL" />
- <result column="motor_power" property="motorPower" jdbcType="DECIMAL" />
- <result column="rated_speed" property="ratedSpeed" jdbcType="DECIMAL" />
- <result column="layer_station_door" property="layerStationDoor" jdbcType="VARCHAR" />
- <result column="clamp_type" property="clampType" jdbcType="TINYINT" />
- <result column="reform_company" property="reformCompany" jdbcType="VARCHAR" />
- <result column="device_position" property="devicePosition" jdbcType="VARCHAR" />
- <result column="coordinate" property="coordinate" jdbcType="VARCHAR" />
- <result column="remarks" property="remarks" jdbcType="VARCHAR" />
- <result column="creator_id" property="creatorId" jdbcType="BIGINT" />
- <result column="create_date" property="createDate" jdbcType="TIMESTAMP" />
- <result column="steel_belt" property="steelBelt" jdbcType="INTEGER" />
- <result column="cylinder_type" property="cylinderType" jdbcType="VARCHAR" />
- <result column="cylinder_num" property="cylinderNum" jdbcType="INTEGER" />
- <result column="top_type" property="topType" jdbcType="TINYINT" />
- <result column="control_type" property="controlType" jdbcType="VARCHAR" />
- <result column="mpa" property="mpa" jdbcType="INTEGER" />
- <result column="factory" property="factory" jdbcType="VARCHAR" />
- <result column="custom_number" property="customNumber" jdbcType="VARCHAR" />
- <result column="use_company_code" property="useCompanyCode" jdbcType="VARCHAR" />
- <result column="device_position_code" property="devicePositionCode" jdbcType="CHAR" />
- <result column="agency" property="agency" jdbcType="VARCHAR" />
- <result column="reform_date" property="reformDate" jdbcType="TIMESTAMP" />
- <result column="install_date" property="installDate" jdbcType="TIMESTAMP" />
- <result column="inner_floor" property="innerFloor" jdbcType="TINYINT" />
- <result column="annual_inspection_date" property="annualInspectionDate" jdbcType="DATE" />
- <result column="area_code" property="areaCode" jdbcType="CHAR" />
- <result column="device_id" property="deviceId" jdbcType="VARCHAR" />
- <result column="device_type" property="deviceType" jdbcType="TINYINT" />
- </resultMap>
- <sql id="Base_Column_List" >
- id, registration_code, category, lift_type, lift_code, manufacture_date, factory_code,
- device_usage, lift_brand, install_company, lift_model, pulley_diameter, rope_num,
- lock_model, rated_load, promote_height, step_width, sidewalk_length, tilt_angle,
- motor_power, rated_speed, layer_station_door, clamp_type, reform_company, device_position,
- coordinate, remarks, creator_id, create_date, steel_belt, cylinder_type, cylinder_num,
- top_type, control_type, mpa, factory, custom_number, use_company_code, device_position_code,
- agency, reform_date, install_date, inner_floor, annual_inspection_date, area_code, device_id, device_type
- </sql>
- <!-- 根据区域,项目,电梯号,电梯品牌,电梯类型,维保工查询电梯列表信息-->
- <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.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,
- plr.first_time AS firstMaintenanceTime,
- p.project_name AS projectName
- FROM platform_company_lift_relevance pclr
- LEFT JOIN lift l ON pclr.lift_id = l.id
- LEFT JOIN project_lift_relevance plr ON pclr.company_id = plr.company_id and pclr.lift_id = plr.lift_id
- LEFT JOIN project p ON pclr.company_id = p.mt_company_id and plr.project_id = p.id
- LEFT JOIN lift_brand lb ON l.lift_brand = lb.code
- WHERE 1=1
- <if test="request.companyId!=null and request.companyId!=''">
- AND pclr.company_id = #{request.companyId,jdbcType=BIGINT}
- </if>
- <if test="request.liftStatus != null and request.liftStatus != '' and request.liftStatus == 1">
- AND pclr.lift_company_status != 1
- </if>
- <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}
- </if>
- <if test="request.liftBrand!=null and request.liftBrand!=''">
- 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}
- </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 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 l.id = plr.lift_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.projectId!=null and request.projectId!=''">
- AND plr.project_id = #{request.projectId,jdbcType=BIGINT}
- </if>
- </select>
- <!--根据注册代码查询电梯是否存在,返回电梯id -->
- <select id="findLiftExist" parameterType="java.lang.String" resultType="java.lang.Long">
- SELECT id FROM lift
- WHERE registration_code = #{registrationCode,jdbcType=VARCHAR}
- </select>
- </mapper>
|