MaintenanceDao.xml 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637
  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="platform.modules.build.dao.MaintenanceDao">
  4. <select id="findLatestMaintenance" resultType="platform.modules.build.entity.Maintenance"
  5. parameterType="platform.modules.build.DTO.MaintenanceDto">
  6. SELECT * FROM y_maintenance t
  7. left join z_user zUser on zUser.id = t.create_by
  8. WHERE
  9. t.del_flag=0 and t.status=0
  10. <if test="company_id!=null">
  11. and zUser.company_id=#{company_id}
  12. </if>
  13. <if test="build_id!=null">
  14. and t.build_id = #{build_id}
  15. </if>
  16. and t.is_processed=0
  17. order by t.create_time desc limit #{count}
  18. </select>
  19. <select id="findExportMaintenance" resultType="platform.modules.sys.report.MaintenanceExport">
  20. SELECT t.company_name,t.location,t.report_user_name,t.contact,t.question_name,t.create_time,
  21. CASE WHEN t.is_processed=1 THEN '已处理'
  22. ELSE '未处理' end as status_name
  23. FROM y_maintenance t WHERE t.build_id = #{build_id}
  24. and t.del_flag=0 and t.status=#{request.is_archive}
  25. <if test="request.keyword!=null and request.keyword!=''">
  26. and (t.company_name like CONCAT('%',#{request.keyword},'%')
  27. or t.report_user_name like CONCAT('%',#{request.keyword},'%')
  28. )
  29. </if>
  30. order by t.create_time desc
  31. </select>
  32. </mapper>