ProjectStaffRecordMapper.xml 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  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.ruoyi.project.mapper.ProjectStaffRecordMapper">
  4. <resultMap id="BaseResultMap" type="com.ruoyi.project.domain.ProjectStaffRecord">
  5. <id column="id" jdbcType="BIGINT" property="id" />
  6. <result column="pid" jdbcType="BIGINT" property="pid" />
  7. <result column="aid" jdbcType="BIGINT" property="aid" />
  8. <result column="name" jdbcType="VARCHAR" property="name" />
  9. <result column="project_status" jdbcType="INTEGER" property="projectStatus" />
  10. <result column="content" jdbcType="VARCHAR" property="content" />
  11. <result column="annex_url" jdbcType="VARCHAR" property="annexUrl" />
  12. <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
  13. <result column="process_status" jdbcType="INTEGER" property="processStatus" />
  14. <result column="duration" jdbcType="DOUBLE" property="duration" />
  15. <result column="examine_id" jdbcType="BIGINT" property="examineId" />
  16. <result column="examine_name" jdbcType="INTEGER" property="examineName" />
  17. <result column="examine_time" jdbcType="TIMESTAMP" property="examineTime" />
  18. </resultMap>
  19. <sql id="Base_Column_List">
  20. id, pid, aid, `name`, project_status, content, annex_url, create_time, process_status,
  21. duration, examine_id, examine_name, examine_time
  22. </sql>
  23. <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
  24. select
  25. <include refid="Base_Column_List" />
  26. from project_staff_record
  27. where id = #{id,jdbcType=BIGINT}
  28. </select>
  29. <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
  30. delete from project_staff_record
  31. where id = #{id,jdbcType=BIGINT}
  32. </delete>
  33. <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.ruoyi.project.domain.ProjectStaffRecord" useGeneratedKeys="true">
  34. insert into project_staff_record (pid, aid, `name`,
  35. project_status, content, annex_url,
  36. create_time, process_status, duration,
  37. examine_id, examine_name, examine_time
  38. )
  39. values (#{pid,jdbcType=BIGINT}, #{aid,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR},
  40. #{projectStatus,jdbcType=INTEGER}, #{content,jdbcType=VARCHAR}, #{annexUrl,jdbcType=VARCHAR},
  41. #{createTime,jdbcType=TIMESTAMP}, #{processStatus,jdbcType=INTEGER}, #{duration,jdbcType=DOUBLE},
  42. #{examineId,jdbcType=BIGINT}, #{examineName,jdbcType=INTEGER}, #{examineTime,jdbcType=TIMESTAMP}
  43. )
  44. </insert>
  45. <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.ruoyi.project.domain.ProjectStaffRecord" useGeneratedKeys="true">
  46. insert into project_staff_record
  47. <trim prefix="(" suffix=")" suffixOverrides=",">
  48. <if test="pid != null">
  49. pid,
  50. </if>
  51. <if test="aid != null">
  52. aid,
  53. </if>
  54. <if test="name != null">
  55. `name`,
  56. </if>
  57. <if test="projectStatus != null">
  58. project_status,
  59. </if>
  60. <if test="content != null">
  61. content,
  62. </if>
  63. <if test="annexUrl != null">
  64. annex_url,
  65. </if>
  66. <if test="createTime != null">
  67. create_time,
  68. </if>
  69. <if test="processStatus != null">
  70. process_status,
  71. </if>
  72. <if test="duration != null">
  73. duration,
  74. </if>
  75. <if test="examineId != null">
  76. examine_id,
  77. </if>
  78. <if test="examineName != null">
  79. examine_name,
  80. </if>
  81. <if test="examineTime != null">
  82. examine_time,
  83. </if>
  84. </trim>
  85. <trim prefix="values (" suffix=")" suffixOverrides=",">
  86. <if test="pid != null">
  87. #{pid,jdbcType=BIGINT},
  88. </if>
  89. <if test="aid != null">
  90. #{aid,jdbcType=BIGINT},
  91. </if>
  92. <if test="name != null">
  93. #{name,jdbcType=VARCHAR},
  94. </if>
  95. <if test="projectStatus != null">
  96. #{projectStatus,jdbcType=INTEGER},
  97. </if>
  98. <if test="content != null">
  99. #{content,jdbcType=VARCHAR},
  100. </if>
  101. <if test="annexUrl != null">
  102. #{annexUrl,jdbcType=VARCHAR},
  103. </if>
  104. <if test="createTime != null">
  105. #{createTime,jdbcType=TIMESTAMP},
  106. </if>
  107. <if test="processStatus != null">
  108. #{processStatus,jdbcType=INTEGER},
  109. </if>
  110. <if test="duration != null">
  111. #{duration,jdbcType=DOUBLE},
  112. </if>
  113. <if test="examineId != null">
  114. #{examineId,jdbcType=BIGINT},
  115. </if>
  116. <if test="examineName != null">
  117. #{examineName,jdbcType=INTEGER},
  118. </if>
  119. <if test="examineTime != null">
  120. #{examineTime,jdbcType=TIMESTAMP},
  121. </if>
  122. </trim>
  123. </insert>
  124. <update id="updateByPrimaryKeySelective" parameterType="com.ruoyi.project.domain.ProjectStaffRecord">
  125. update project_staff_record
  126. <set>
  127. <if test="pid != null">
  128. pid = #{pid,jdbcType=BIGINT},
  129. </if>
  130. <if test="aid != null">
  131. aid = #{aid,jdbcType=BIGINT},
  132. </if>
  133. <if test="name != null">
  134. `name` = #{name,jdbcType=VARCHAR},
  135. </if>
  136. <if test="projectStatus != null">
  137. project_status = #{projectStatus,jdbcType=INTEGER},
  138. </if>
  139. <if test="content != null">
  140. content = #{content,jdbcType=VARCHAR},
  141. </if>
  142. <if test="annexUrl != null">
  143. annex_url = #{annexUrl,jdbcType=VARCHAR},
  144. </if>
  145. <if test="createTime != null">
  146. create_time = #{createTime,jdbcType=TIMESTAMP},
  147. </if>
  148. <if test="processStatus != null">
  149. process_status = #{processStatus,jdbcType=INTEGER},
  150. </if>
  151. <if test="duration != null">
  152. duration = #{duration,jdbcType=DOUBLE},
  153. </if>
  154. <if test="examineId != null">
  155. examine_id = #{examineId,jdbcType=BIGINT},
  156. </if>
  157. <if test="examineName != null">
  158. examine_name = #{examineName,jdbcType=INTEGER},
  159. </if>
  160. <if test="examineTime != null">
  161. examine_time = #{examineTime,jdbcType=TIMESTAMP},
  162. </if>
  163. </set>
  164. where id = #{id,jdbcType=BIGINT}
  165. </update>
  166. <update id="updateByPrimaryKey" parameterType="com.ruoyi.project.domain.ProjectStaffRecord">
  167. update project_staff_record
  168. set pid = #{pid,jdbcType=BIGINT},
  169. aid = #{aid,jdbcType=BIGINT},
  170. `name` = #{name,jdbcType=VARCHAR},
  171. project_status = #{projectStatus,jdbcType=INTEGER},
  172. content = #{content,jdbcType=VARCHAR},
  173. annex_url = #{annexUrl,jdbcType=VARCHAR},
  174. create_time = #{createTime,jdbcType=TIMESTAMP},
  175. process_status = #{processStatus,jdbcType=INTEGER},
  176. duration = #{duration,jdbcType=DOUBLE},
  177. examine_id = #{examineId,jdbcType=BIGINT},
  178. examine_name = #{examineName,jdbcType=INTEGER},
  179. examine_time = #{examineTime,jdbcType=TIMESTAMP}
  180. where id = #{id,jdbcType=BIGINT}
  181. </update>
  182. <select id="selectList" resultType="com.ruoyi.project.bo.ProjectStaffRecordOut">
  183. select a.id,c.job_number jobNumber,a.name ,d.dept_id deptId ,d.dept_name deptName ,c.create_time createMonth,
  184. b.id projectId,b.name projectName,b.admin_name adminName ,a.project_status projectStatus,a.content ,
  185. a.pid ,a.aid ,a.examine_id examineId ,a.examine_name examineName ,a.examine_time examineTime,
  186. a.annex_url annexUrl,a.create_time createTime,a.process_status processStatus , a.duration
  187. from project_staff_record a left join project_task b on a.pid=b.id
  188. left join sys_user c on a.aid=c.user_id left join sys_dept d on c.dept_id =d.dept_id
  189. where 1=1
  190. <if test="roleType==0">
  191. and a.aid =#{aid}
  192. </if>
  193. <if test="roleType==1">
  194. and a.aid in (select user_id from sys_user_role where role_id=2)
  195. </if>
  196. <if test="roleType==2">
  197. and a.aid in (select user_id from sys_user_role where role_id=3)
  198. </if>
  199. <if test="processStatus !=null">
  200. and a.process_status= #{processStatus}
  201. </if>
  202. </select>
  203. </mapper>