RepairProjectMapper.xml 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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.RepairProjectMapper">
  4. <sql id="Base_Column_List">
  5. repairProject.id,
  6. repairProject.name,
  7. repairProject.no,
  8. repairProject.type,
  9. repairProject.repair_id,
  10. repairProject.technology,
  11. repairProject.standard_hours,
  12. repairProject.standard_money,
  13. repairProject.check_hours,
  14. repairProject.sort,
  15. repairProject.delFlag,
  16. repairProject.remark,
  17. repairProject.created_user_id,
  18. repairProject.update_user_id,
  19. repairProject.created_user_name,
  20. repairProject.update_user_name,
  21. repairProject.created_time,
  22. repairProject.update_time
  23. </sql>
  24. <sql id="Ref_Column_List">
  25. repairProject.id,
  26. repairProject.name,repairProject.repair_id,
  27. repairProject.no,
  28. repairProject.type,
  29. repairProject.technology,
  30. repairProject.standard_hours,
  31. repairProject.standard_money,
  32. repairProject.check_hours,
  33. repairProject.sort,
  34. repairProject.delFlag,
  35. repairProject.remark
  36. </sql>
  37. <sql id="List_Condition">
  38. <if test="id != null and id != ''">
  39. and repairProject.id = #{id}
  40. </if>
  41. <if test="name != null and name != ''">
  42. and repairProject.name = #{name}
  43. </if>
  44. <if test="repairId != null and repairId != ''">
  45. and repairProject.repair_id = #{repairId}
  46. </if>
  47. <if test="no != null and no != ''">
  48. and repairProject.no = #{no}
  49. </if>
  50. <if test="type != null">
  51. and repairProject.type = #{type}
  52. </if>
  53. <if test="remark != null and remark != ''">
  54. and repairProject.remark = #{remark}
  55. </if>
  56. <if test="keyword != null and keyword != ''">
  57. and repairProject.name like concat('%',#{keyword},'%')
  58. </if>
  59. </sql>
  60. <select id="selectList" parameterType="com.platform.dao.dto.repair.RepairProjectDTO" resultType="com.platform.dao.entity.repair.RepairProject">
  61. select repairProject.*
  62. from t_repair_project as repairProject
  63. <where>
  64. <include refid="List_Condition"/>
  65. </where>
  66. order by repairProject.sort asc
  67. </select>
  68. <select id="selectRepairProjectListByRepairId" resultType="com.platform.dao.vo.repair.RepairProjectVO">
  69. select project.*, repair.id as repairId, tcppr.id as relationId
  70. from t_repair_project_relation tcppr
  71. inner join t_repair_application_form repair on tcppr.repair_id = repair.id
  72. inner join t_repair_project project on tcppr.project_id = project.id
  73. where tcppr.repair_id = #{repairId}
  74. </select>
  75. </mapper>