LiftDataMapper.xml 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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.batch.applet.dao.mapper.LiftDataMapper">
  4. <!-- 获取指定时间段内的电梯数据 -->
  5. <select id="getLiftDataList" parameterType="cn.com.ty.lift.batch.applet.dao.model.request.CommonRequest"
  6. resultType="cn.com.ty.lift.batch.applet.dao.model.LiftDataModel">
  7. select
  8. pclr.mt_company_id as mtCompanyId,
  9. pclr.create_date as connectTime,
  10. pclr.update_date as updateTime,
  11. pclr.lift_company_status as liftCompanyStatus,
  12. p.id as projectId,
  13. p.project_name as projectName,
  14. p.project_status as projectStatus,
  15. p.end_date as projectEndTime,
  16. plr.out_service_date as lostTime,
  17. r.id as regionId,
  18. r.area_name as regionName
  19. from
  20. platform_company_lift_relevance pclr
  21. left join
  22. project_lift_relevance plr
  23. on
  24. pclr.lift_id = plr.lift_id
  25. left join
  26. project p
  27. on
  28. plr.project_id = p.id
  29. left join
  30. region r
  31. on
  32. p.region_id = r.id
  33. where
  34. pclr.mt_company_id = #{mtCompanyId} and r.mt_company_id = pclr.mt_company_id
  35. <!-- <if test = "startTimeDateStr != null and startTimeDateStr != ''">-->
  36. <!-- and (-->
  37. <!-- pclr.create_date <![CDATA[ >= ]]> #{startTimeDateStr}-->
  38. <!-- or-->
  39. <!-- pclr.create_date is null)-->
  40. <!-- </if>-->
  41. <if test = "endTimeDateStr != null and endTimeDateStr != ''">
  42. and (
  43. pclr.create_date <![CDATA[ <= ]]> #{endTimeDateStr}
  44. or
  45. pclr.create_date is null)
  46. </if>
  47. </select>
  48. </mapper>