RepairApplicationFormMapper.xml 4.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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="com.platform.dao.mapper.repair.RepairApplicationFormMapper">
  4. <sql id="Base_Column_List">
  5. application.*,
  6. user.real_name as userName,
  7. sb.name as sbName,part.name as partName,
  8. sb.no as sbNo, sb.cph as sbCph, sb.model_id as modelId,
  9. error.name as repairErrorTypeName
  10. </sql>
  11. <select id="selectPageList" parameterType="com.platform.dao.dto.repair.RepairApplicationFormDTO"
  12. resultType="com.platform.dao.vo.repair.RepairApplicationFormVO">
  13. select
  14. <include refid="Base_Column_List"/>
  15. from t_repair_application_form application
  16. left join t_sys_user user on application.user_id = user.user_id
  17. left join t_sb_info sb on application.sb_id = sb.id
  18. left join t_error_type error on application.repair_error_type_id = error.id
  19. left join t_part_info part on application.part_id = part.id
  20. <where>
  21. <if test="keyword != null and keyword != ''">
  22. and ( sb.name like concat('%',#{keyword},'%') or
  23. sb.no like concat('%',#{keyword},'%') or
  24. application.content like concat('%',#{keyword},'%') )
  25. </if>
  26. <if test="content != null and content != ''">
  27. and application.content like concat('%',#{content},'%')
  28. </if>
  29. <if test="sbId != null and sbId != ''">
  30. and application.sb_id = #{sbId}
  31. </if>
  32. <if test="zbh != null and zbh != ''">
  33. and sb.zbh = #{zbh}
  34. </if>
  35. <if test="no != null and no != ''">
  36. and application.no = #{no}
  37. </if>
  38. <if test="actualUser != null and actualUser != ''">
  39. and application.actual_user = #{actualUser}
  40. </if>
  41. <if test="mainRepairId != null and mainRepairId != ''">
  42. and application.main_repair_id = #{mainRepairId}
  43. </if>
  44. <if test="outType != null and outType != ''">
  45. and application.out_type = #{outType}
  46. </if>
  47. <if test="type != null and type != ''">
  48. and application.type = #{type}
  49. </if>
  50. <if test="status != null and status != ''">
  51. and application.status = #{status}
  52. </if>
  53. <if test="userId != null and userId != ''">
  54. and application.user_id = #{userId}
  55. </if>
  56. <if test="repairUserId != null and repairUserId != ''">
  57. <if test="repairUserIdOrNoAssignFlag != null and repairUserIdOrNoAssignFlag == true">
  58. and (application.repair_user_id = #{repairUserId} or application.repair_user_id is null)
  59. </if>
  60. <if test="repairUserIdOrNoAssignFlag == null || repairUserIdOrNoAssignFlag == false">
  61. and application.repair_user_id = #{repairUserId}
  62. </if>
  63. </if>
  64. <if test="checkUserId != null and checkUserId != ''">
  65. and application.check_user_id = #{checkUserId}
  66. </if>
  67. <if test="searchStartTime != null">
  68. and checkjob.start_time <![CDATA[ >= ]]> #{searchStartTime}
  69. </if>
  70. <if test="searchEndTime != null">
  71. and checkjob.start_time <![CDATA[ <= ]]> #{searchEndTime}
  72. </if>
  73. </where>
  74. </select>
  75. <select id="selectById" parameterType="java.lang.Object"
  76. resultType="com.platform.dao.entity.repair.RepairApplicationForm">
  77. select
  78. <include refid="Base_Column_List"/>
  79. from t_repair_application_form application
  80. left join t_sys_user user on application.user_id = user.user_id
  81. left join t_sb_info sb on application.sb_id = sb.id
  82. left join t_part_info part on application.part_id = part.id
  83. left join t_error_type error on application.repair_error_type_id = error.id
  84. where application.id = #{id,jdbcType=VARCHAR}
  85. </select>
  86. <select id="selectNoById" parameterType="java.lang.Object" resultType="java.lang.String">
  87. select no
  88. from t_repair_application_form
  89. where id = #{id,jdbcType=VARCHAR}
  90. </select>
  91. </mapper>