AnnualInspectionMapper.xml 3.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
  3. <mapper namespace="cn.com.ty.lift.business.annualinspection.mapper.AnnualInspectionMapper" >
  4. <resultMap id="BaseResultMap" type="cn.com.ty.lift.business.annualinspection.dto.InspectionResponse" >
  5. <id column="id" property="id" jdbcType="BIGINT" />
  6. <result column="lift_id" property="liftId" jdbcType="BIGINT" />
  7. <result column="mt_company_id" property="mtCompanyId" jdbcType="BIGINT" />
  8. <result column="plan_date" property="planDate" jdbcType="TIMESTAMP" />
  9. <result column="is_check_governer" property="isCheckGoverner" jdbcType="TINYINT" />
  10. <result column="finish_time" property="finishTime" jdbcType="TIMESTAMP" />
  11. <result column="inspector" property="inspector" jdbcType="VARCHAR" />
  12. <result column="telephone" property="telephone" jdbcType="VARCHAR" />
  13. <result column="operator" property="operator" jdbcType="VARCHAR" />
  14. <result column="creator_id" property="creatorId" jdbcType="BIGINT" />
  15. <result column="create_date" property="createDate" jdbcType="TIMESTAMP" />
  16. <result column="status" property="status" jdbcType="TINYINT" />
  17. <result column="next_inspection_time" property="nextInspectionTime" jdbcType="TIMESTAMP" />
  18. <result column="selfcheck_report_img" property="selfcheckReportImg" jdbcType="VARCHAR" />
  19. <result column="check_result_img" property="checkResultImg" jdbcType="VARCHAR" />
  20. <result column="annual_inspection_img" property="annualInspectionImg" jdbcType="VARCHAR" />
  21. <result column="step_status" property="stepStatus" jdbcType="INTEGER" />
  22. <result column="begin_inspection_date" property="beginInspectionDate" jdbcType="TIMESTAMP" />
  23. <result column="area_name" property="areaName" jdbcType="VARCHAR" />
  24. <result column="project_name" property="projectName" jdbcType="VARCHAR" />
  25. <result column="registration_code" property="registrationCode" jdbcType="VARCHAR" />
  26. <result column="lift_code" property="liftCode" jdbcType="VARCHAR" />
  27. <result column="device_position" property="devicePosition" jdbcType="VARCHAR" />
  28. </resultMap>
  29. <!--多条件查询年检记录-->
  30. <select id="listByCondition" resultMap="BaseResultMap" parameterType="cn.com.ty.lift.business.annualinspection.dto.InspectionRequest" >
  31. SELECT
  32. ai.*,
  33. re.area_name AS area_name,
  34. pr.project_name AS project_name,
  35. li.registration_code AS registration_code,
  36. li.lift_code AS lift_code,
  37. li.device_position AS device_position
  38. FROM
  39. annual_inspection ai
  40. LEFT JOIN lift li ON ai.lift_id = li.id
  41. LEFT JOIN project_lift_relevance plr ON plr.lift_id = ai.lift_id
  42. LEFT JOIN user_info ui ON ui.user_id = plr.user_id
  43. LEFT JOIN region re ON re.mt_company_id = ai.mt_company_id
  44. LEFT JOIN project pr ON pr.mt_company_id = ai.mt_company_id
  45. WHERE
  46. ai.status = #{cond.status}
  47. <if test="cond.workerId != null and cond.workerId > 0">
  48. AND ui.user_id = #{cond.workerId}
  49. </if>
  50. <if test="cond.info != null and cond.info != ''">
  51. AND li.registration_code LIKE #{cond.info}
  52. </if>
  53. <if test="cond.regionId != null and cond.regionId > 0">
  54. AND re.id = #{cond.regionId}
  55. </if>
  56. <if test="cond.projectId != null and cond.projectId > 0">
  57. AND pr.id = #{cond.projectId}
  58. </if>
  59. <if test="cond.stepStatus != null">
  60. AND ai.step_status = #{cond.stepStatus}
  61. </if>
  62. </select>
  63. </mapper>