RepairApplicationFormMapper.xml 5.4 KB

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