综合办公系统
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

CmcTechnicalMapper.xml 11KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  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.oa.mapper.CmcTechnicalMapper">
  6. <resultMap type="CmcTechnical" id="CmcTechnicalResult">
  7. <result property="technicalId" column="technical_id" />
  8. <result property="projectId" column="project_id" />
  9. <result property="technicalDirector" column="technical_director" />
  10. <result property="technicalDesigner" column="technical_designer" />
  11. <result property="technicalPlanner" column="technical_planner" />
  12. <result property="planComment" column="plan_comment" />
  13. <result property="qualityInspector" column="quality_inspector" />
  14. <result property="technicalTime" column="technical_time" />
  15. <result property="technicalDocument" column="technical_document" />
  16. <result property="modifyDocument" column="modify_document" />
  17. <result property="finalDocument" column="final_document" />
  18. <result property="designDescription" column="design_description" />
  19. <result property="technicalComment" column="technical_comment" />
  20. <result property="manageComment" column="manage_comment" />
  21. <result property="technicalUploadTime" column="technical_upload_time" />
  22. <result property="techApprovalTime" column="tech_approval_time" />
  23. <result property="manageApprovalTime" column="manage_approval_time" />
  24. <association property="directUser" javaType="SysUser" resultMap="DirectUserResult" />
  25. <association property="planUser" javaType="SysUser" resultMap="PlanUserResult" />
  26. <association property="designUser" javaType="SysUser" resultMap="DesignUserResult" />
  27. <association property="managerUser" javaType="SysUser" resultMap="ManagerUserResult" />
  28. <association property="project" javaType="CmcProject" resultMap="CmcProjectResult" />
  29. </resultMap>
  30. <resultMap type="SysUser" id="DirectUserResult">
  31. <result property="userId" column="user_id" />
  32. <result property="nickName" column="direct_nick_name" />
  33. </resultMap>
  34. <resultMap type="SysUser" id="PlanUserResult">
  35. <result property="userId" column="user_id" />
  36. <result property="nickName" column="plan_nick_name" />
  37. </resultMap>
  38. <resultMap type="SysUser" id="DesignUserResult">
  39. <result property="userId" column="user_id" />
  40. <result property="nickName" column="design_nick_name" />
  41. </resultMap>
  42. <resultMap type="SysUser" id="ManagerUserResult">
  43. <result property="userId" column="user_id" />
  44. <result property="nickName" column="manager_nick_name" />
  45. </resultMap>
  46. <resultMap type="CmcProject" id="CmcProjectResult">
  47. <result property="projectId" column="project_id" />
  48. <result property="projectNumber" column="project_number" />
  49. <result property="projectName" column="project_name" />
  50. </resultMap>
  51. <sql id="selectCmcTechnicalVo">
  52. select t.technical_id, t.project_id, p.project_number, p.project_name, t.technical_director, u.nick_name as direct_nick_name, t.technical_designer, u1.nick_name as design_nick_name,
  53. t.technical_planner, u2.nick_name as plan_nick_name, t.plan_comment, t.quality_inspector, t.technical_time, t.technical_document, t.modify_document, t.final_document,
  54. t.design_description, t.technical_comment, t.manager_user_id, u3.nick_name as manager_nick_name, t.manage_comment, t.technical_upload_time, t.tech_approval_time, t.manage_approval_time from cmc_technical as t
  55. left join sys_user as u on u.user_id = t.technical_director
  56. left join sys_user as u1 on u1.user_id = t.technical_designer
  57. left join sys_user as u2 on u2.user_id = t.technical_planner
  58. left join sys_user as u3 on u3.user_id = t.manager_user_id
  59. left join cmc_project as p on p.project_id = t.project_id
  60. </sql>
  61. <select id="selectCmcTechnicalList" parameterType="CmcTechnical" resultMap="CmcTechnicalResult">
  62. <include refid="selectCmcTechnicalVo"/>
  63. <where>
  64. <if test="projectId != null and projectId != ''"> and t.project_id = #{projectId}</if>
  65. <if test="technicalDirector != null "> and t.technical_director = #{technicalDirector}</if>
  66. <if test="technicalDesigner != null "> and t.technical_designer = #{technicalDesigner}</if>
  67. <if test="technicalPlanner != null "> and t.technical_planner = #{technicalPlanner}</if>
  68. <if test="planComment != null and planComment != ''"> and t.plan_comment = #{planComment}</if>
  69. <if test="qualityInspector != null and qualityInspector != ''"> and t.quality_inspector = #{qualityInspector}</if>
  70. <if test="technicalTime != null "> and t.technical_time = #{technicalTime}</if>
  71. <if test="technicalDocument != null and technicalDocument != ''"> and t.technical_document = #{technicalDocument}</if>
  72. <if test="designDescription != null and designDescription != ''"> and t.design_description = #{designDescription}</if>
  73. <if test="technicalComment != null and technicalComment != ''"> and t.technical_comment = #{technicalComment}</if>
  74. <if test="managerUserId != null "> and t.manager_user_id = #{managerUserId}</if>
  75. <if test="manageComment != null and manageComment != ''"> and t.manage_comment = #{manageComment}</if>
  76. <if test="technicalUploadTime != null "> and t.technical_upload_time = #{technicalUploadTime}</if>
  77. <if test="techApprovalTime != null "> and t.tech_approval_time = #{techApprovalTime}</if>
  78. <if test="manageApprovalTime != null "> and t.manage_approval_time = #{manageApprovalTime}</if>
  79. </where>
  80. order by technical_time desc
  81. </select>
  82. <select id="selectCmcTechnicalByTechnicalId" parameterType="String" resultMap="CmcTechnicalResult">
  83. <include refid="selectCmcTechnicalVo"/>
  84. where t.technical_id = #{technicalId}
  85. </select>
  86. <insert id="insertCmcTechnical" parameterType="CmcTechnical">
  87. insert into cmc_technical
  88. <trim prefix="(" suffix=")" suffixOverrides=",">
  89. <if test="technicalId != null">technical_id,</if>
  90. <if test="projectId != null">project_id,</if>
  91. <if test="technicalDirector != null">technical_director,</if>
  92. <if test="technicalDesigner != null">technical_designer,</if>
  93. <if test="technicalPlanner != null">technical_planner,</if>
  94. <if test="planComment != null">plan_comment,</if>
  95. <if test="qualityInspector != null">quality_inspector,</if>
  96. <if test="technicalTime != null">technical_time,</if>
  97. <if test="technicalDocument != null">technical_document,</if>
  98. <if test="modifyDocument != null">modify_document,</if>
  99. <if test="finalDocument != null">final_document,</if>
  100. <if test="designDescription != null">design_description,</if>
  101. <if test="technicalComment != null">technical_comment,</if>
  102. <if test="managerUserId != null">manager_user_id,</if>
  103. <if test="manageComment != null">manage_comment,</if>
  104. <if test="technicalUploadTime != null">technical_upload_time,</if>
  105. <if test="techApprovalTime != null">tech_approval_time,</if>
  106. <if test="manageApprovalTime != null">manage_approval_time,</if>
  107. </trim>
  108. <trim prefix="values (" suffix=")" suffixOverrides=",">
  109. <if test="technicalId != null">#{technicalId},</if>
  110. <if test="projectId != null">#{projectId},</if>
  111. <if test="technicalDirector != null">#{technicalDirector},</if>
  112. <if test="technicalDesigner != null">#{technicalDesigner},</if>
  113. <if test="technicalPlanner != null">#{technicalPlanner},</if>
  114. <if test="planComment != null">#{planComment},</if>
  115. <if test="qualityInspector != null">#{qualityInspector},</if>
  116. <if test="technicalTime != null">#{technicalTime},</if>
  117. <if test="technicalDocument != null">#{technicalDocument},</if>
  118. <if test="modifyDocument != null">#{modifyDocument},</if>
  119. <if test="finalDocument != null">#{finalDocument},</if>
  120. <if test="designDescription != null">#{designDescription},</if>
  121. <if test="technicalComment != null">#{technicalComment},</if>
  122. <if test="managerUserId != null">#{managerUserId},</if>
  123. <if test="manageComment != null">#{manageComment},</if>
  124. <if test="technicalUploadTime != null">#{technicalUploadTime},</if>
  125. <if test="techApprovalTime != null">#{techApprovalTime},</if>
  126. <if test="manageApprovalTime != null">#{manageApprovalTime},</if>
  127. </trim>
  128. </insert>
  129. <update id="updateCmcTechnical" parameterType="CmcTechnical">
  130. update cmc_technical
  131. <trim prefix="SET" suffixOverrides=",">
  132. <if test="projectId != null">project_id = #{projectId},</if>
  133. <if test="technicalDirector != null">technical_director = #{technicalDirector},</if>
  134. <if test="technicalDesigner != null">technical_designer = #{technicalDesigner},</if>
  135. <if test="technicalPlanner != null">technical_planner = #{technicalPlanner},</if>
  136. <if test="planComment != null">plan_comment = #{planComment},</if>
  137. <if test="qualityInspector != null">quality_inspector = #{qualityInspector},</if>
  138. <if test="technicalTime != null">technical_time = #{technicalTime},</if>
  139. <if test="technicalDocument != null">technical_document = #{technicalDocument},</if>
  140. <if test="modifyDocument != null">modify_document = #{modifyDocument},</if>
  141. <if test="finalDocument != null">final_document = #{finalDocument},</if>
  142. <if test="designDescription != null">design_description = #{designDescription},</if>
  143. <if test="technicalComment != null">technical_comment = #{technicalComment},</if>
  144. <if test="managerUserId != null">manager_user_id = #{managerUserId},</if>
  145. <if test="manageComment != null">manage_comment = #{manageComment},</if>
  146. <if test="technicalUploadTime != null">technical_upload_time = #{technicalUploadTime},</if>
  147. <if test="techApprovalTime != null">tech_approval_time = #{techApprovalTime},</if>
  148. <if test="manageApprovalTime != null">manage_approval_time = #{manageApprovalTime},</if>
  149. </trim>
  150. where technical_id = #{technicalId}
  151. </update>
  152. <delete id="deleteCmcTechnicalByTechnicalId" parameterType="String">
  153. delete from cmc_technical where technical_id = #{technicalId}
  154. </delete>
  155. <delete id="deleteCmcTechnicalByTechnicalIds" parameterType="String">
  156. delete from cmc_technical where technical_id in
  157. <foreach item="technicalId" collection="array" open="(" separator="," close=")">
  158. #{technicalId}
  159. </foreach>
  160. </delete>
  161. </mapper>