TApproveMaintenanceMapper.xml 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="com.ruoyi.project.intact.mapper.TApproveMaintenanceMapper">
  6. <resultMap type="TApproveMaintenance" id="TApproveMaintenanceResult">
  7. <result property="id" column="id" />
  8. <result property="userId" column="user_id" />
  9. <result property="devId" column="dev_id" />
  10. <result property="devType" column="dev_type" />
  11. <result property="approveType" column="approve_type" />
  12. <result property="content" column="content" />
  13. <result property="fileUrls" column="file_urls" />
  14. <result property="status" column="status" />
  15. <result property="creattime" column="creattime" />
  16. <result property="enddate" column="enddate" />
  17. <result property="processId" column="process_id" />
  18. <result property="apNo" column="ap_no" />
  19. <result property="reportId" column="report_id" />
  20. <result property="monthId" column="month_id" />
  21. <result property="delFlag" column="del_flag" />
  22. <result property="deptId" column="dept_id" />
  23. <result property="deptName" column="dept_name" />
  24. </resultMap>
  25. <sql id="selectTApproveMaintenanceVo">
  26. select d.id, d.user_id, d.dev_id, d.dev_type, d.approve_type, d.content, d.file_urls, d.status, d.creattime, d.enddate, d.process_id, d.ap_no, d.report_id, d.month_id, d.del_flag, d.dept_id ,s.dept_name from t_approve_maintenance d
  27. left join sys_dept s on s.dept_id = d.dept_id
  28. </sql>
  29. <select id="selectTApproveMaintenanceList" parameterType="TApproveMaintenance" resultMap="TApproveMaintenanceResult">
  30. <include refid="selectTApproveMaintenanceVo"/>
  31. <where>
  32. <if test="userId != null "> and user_id = #{userId}</if>
  33. <if test="devId != null and devId != ''"> and dev_id = #{devId}</if>
  34. <if test="devType != null "> and dev_type = #{devType}</if>
  35. <if test="approveType != null "> and approve_type = #{approveType}</if>
  36. <if test="content != null and content != ''"> and content = #{content}</if>
  37. <if test="fileUrls != null and fileUrls != ''"> and file_urls = #{fileUrls}</if>
  38. <if test="status != null "> and status = #{status}</if>
  39. <if test="creattime != null "> and creattime = #{creattime}</if>
  40. <if test="enddate != null "> and enddate = #{enddate}</if>
  41. <if test="processId != null and processId != ''"> and process_id = #{processId}</if>
  42. <if test="apNo != null and apNo != ''"> and ap_no = #{apNo}</if>
  43. <if test="reportId != null and reportId != ''"> and report_id = #{reportId}</if>
  44. <if test="monthId != null and monthId != ''"> and month_id = #{monthId}</if>
  45. <if test="deptId != null "> and dept_id = #{deptId}</if>
  46. and d.del_flag = 0
  47. </where>
  48. <!-- 数据范围过滤 -->
  49. ${params.dataScope}
  50. </select>
  51. <select id="selectTApproveMaintenanceById" parameterType="Long" resultMap="TApproveMaintenanceResult">
  52. <include refid="selectTApproveMaintenanceVo"/>
  53. where id = #{id}
  54. </select>
  55. <insert id="insertTApproveMaintenance" parameterType="TApproveMaintenance">
  56. <selectKey keyProperty="id" resultType="long" order="BEFORE">
  57. SELECT seq_t_approve_maintenance.NEXTVAL as id FROM DUAL
  58. </selectKey>
  59. insert into t_approve_maintenance
  60. <trim prefix="(" suffix=")" suffixOverrides=",">
  61. <if test="id != null">id,</if>
  62. <if test="userId != null">user_id,</if>
  63. <if test="devId != null">dev_id,</if>
  64. <if test="devType != null">dev_type,</if>
  65. <if test="approveType != null">approve_type,</if>
  66. <if test="content != null">content,</if>
  67. <if test="fileUrls != null">file_urls,</if>
  68. <if test="status != null">status,</if>
  69. <if test="creattime != null">creattime,</if>
  70. <if test="enddate != null">enddate,</if>
  71. <if test="processId != null">process_id,</if>
  72. <if test="apNo != null">ap_no,</if>
  73. <if test="reportId != null">report_id,</if>
  74. <if test="monthId != null">month_id,</if>
  75. <if test="delFlag != null">del_flag,</if>
  76. <if test="deptId != null">dept_id,</if>
  77. </trim>
  78. <trim prefix="values (" suffix=")" suffixOverrides=",">
  79. <if test="id != null">#{id},</if>
  80. <if test="userId != null">#{userId},</if>
  81. <if test="devId != null">#{devId},</if>
  82. <if test="devType != null">#{devType},</if>
  83. <if test="approveType != null">#{approveType},</if>
  84. <if test="content != null">#{content},</if>
  85. <if test="fileUrls != null">#{fileUrls},</if>
  86. <if test="status != null">#{status},</if>
  87. <if test="creattime != null">#{creattime},</if>
  88. <if test="enddate != null">#{enddate},</if>
  89. <if test="processId != null">#{processId},</if>
  90. <if test="apNo != null">#{apNo},</if>
  91. <if test="reportId != null">#{reportId},</if>
  92. <if test="monthId != null">#{monthId},</if>
  93. <if test="delFlag != null">#{delFlag},</if>
  94. <if test="deptId != null">#{deptId},</if>
  95. </trim>
  96. </insert>
  97. <update id="updateTApproveMaintenance" parameterType="TApproveMaintenance">
  98. update t_approve_maintenance
  99. <trim prefix="SET" suffixOverrides=",">
  100. <if test="userId != null">user_id = #{userId},</if>
  101. <if test="devId != null">dev_id = #{devId},</if>
  102. <if test="devType != null">dev_type = #{devType},</if>
  103. <if test="approveType != null">approve_type = #{approveType},</if>
  104. <if test="content != null">content = #{content},</if>
  105. <if test="fileUrls != null">file_urls = #{fileUrls},</if>
  106. <if test="status != null">status = #{status},</if>
  107. <if test="creattime != null">creattime = #{creattime},</if>
  108. <if test="enddate != null">enddate = #{enddate},</if>
  109. <if test="processId != null">process_id = #{processId},</if>
  110. <if test="apNo != null">ap_no = #{apNo},</if>
  111. <if test="reportId != null">report_id = #{reportId},</if>
  112. <if test="monthId != null">month_id = #{monthId},</if>
  113. <if test="delFlag != null">del_flag = #{delFlag},</if>
  114. <if test="deptId != null">dept_id = #{deptId},</if>
  115. </trim>
  116. where id = #{id}
  117. </update>
  118. <update id="deleteTApproveMaintenanceById" parameterType="Long">
  119. update t_approve_maintenance set del_flag = 2 where id = #{id}
  120. </update>
  121. <update id="deleteTApproveMaintenanceByIds" parameterType="String">
  122. update t_approve_maintenance set del_flag = 2 where id in
  123. <foreach item="id" collection="array" open="(" separator="," close=")">
  124. #{id}
  125. </foreach>
  126. </update>
  127. </mapper>