12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 |
- <?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.annualinspection.mapper.AnnualInspectionMapper" >
- <resultMap id="BaseResultMap" type="cn.com.ty.lift.business.annualinspection.dto.InspectionResponse" >
- <id column="id" property="id" jdbcType="BIGINT" />
- <result column="lift_id" property="liftId" jdbcType="BIGINT" />
- <result column="mt_company_id" property="mtCompanyId" jdbcType="BIGINT" />
- <result column="plan_date" property="planDate" jdbcType="TIMESTAMP" />
- <result column="is_check_governer" property="isCheckGoverner" jdbcType="TINYINT" />
- <result column="finish_time" property="finishTime" jdbcType="TIMESTAMP" />
- <result column="inspector" property="inspector" jdbcType="VARCHAR" />
- <result column="telephone" property="telephone" jdbcType="VARCHAR" />
- <result column="operator" property="operator" jdbcType="VARCHAR" />
- <result column="creator_id" property="creatorId" jdbcType="BIGINT" />
- <result column="create_date" property="createDate" jdbcType="TIMESTAMP" />
- <result column="status" property="status" jdbcType="TINYINT" />
- <result column="next_inspection_time" property="nextInspectionTime" jdbcType="TIMESTAMP" />
- <result column="selfcheck_report_img" property="selfcheckReportImg" jdbcType="VARCHAR" />
- <result column="check_result_img" property="checkResultImg" jdbcType="VARCHAR" />
- <result column="annual_inspection_img" property="annualInspectionImg" jdbcType="VARCHAR" />
- <result column="step_status" property="stepStatus" jdbcType="INTEGER" />
- <result column="begin_inspection_date" property="beginInspectionDate" jdbcType="TIMESTAMP" />
- <result column="area_name" property="areaName" jdbcType="VARCHAR" />
- <result column="project_name" property="projectName" jdbcType="VARCHAR" />
- <result column="registration_code" property="registrationCode" jdbcType="VARCHAR" />
- <result column="lift_code" property="liftCode" jdbcType="VARCHAR" />
- <result column="device_position" property="devicePosition" jdbcType="VARCHAR" />
- </resultMap>
- <!--多条件查询年检记录-->
- <select id="listByCondition" resultMap="BaseResultMap" parameterType="cn.com.ty.lift.business.annualinspection.dto.InspectionRequest" >
- SELECT
- ai.*,
- re.area_name AS area_name,
- pr.project_name AS project_name,
- li.registration_code AS registration_code,
- li.lift_code AS lift_code,
- li.device_position AS device_position
- FROM
- annual_inspection ai
- LEFT JOIN lift li ON ai.lift_id = li.id
- LEFT JOIN project_lift_relevance plr ON plr.lift_id = ai.lift_id
- LEFT JOIN user_info ui ON ui.user_id = plr.user_id
- LEFT JOIN region re ON re.mt_company_id = ai.mt_company_id
- LEFT JOIN project pr ON pr.mt_company_id = ai.mt_company_id
- WHERE
- ai.status = #{cond.status}
-
- <if test="cond.workerId != null and cond.workerId > 0">
- AND ui.user_id = #{cond.workerId}
- </if>
- <if test="cond.info != null and cond.info != ''">
- AND li.registration_code LIKE #{cond.info}
- </if>
- <if test="cond.regionId != null and cond.regionId > 0">
- AND re.id = #{cond.regionId}
- </if>
- <if test="cond.projectId != null and cond.projectId > 0">
- AND pr.id = #{cond.projectId}
- </if>
- <if test="cond.stepStatus != null">
- AND ai.step_status = #{cond.stepStatus}
- </if>
- </select>
- </mapper>
|