ProjectStaffRecordMapper.xml 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  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. </resultMap>
  16. <sql id="Base_Column_List">
  17. id, pid, aid, `name`, project_status, content, annex_url, create_time, process_status,
  18. duration
  19. </sql>
  20. <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
  21. select
  22. <include refid="Base_Column_List" />
  23. from project_staff_record
  24. where id = #{id,jdbcType=BIGINT}
  25. </select>
  26. <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
  27. delete from project_staff_record
  28. where id = #{id,jdbcType=BIGINT}
  29. </delete>
  30. <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.ruoyi.project.domain.ProjectStaffRecord" useGeneratedKeys="true">
  31. insert into project_staff_record (pid, aid, `name`,
  32. project_status, content, annex_url,
  33. create_time, process_status, duration
  34. )
  35. values (#{pid,jdbcType=BIGINT}, #{aid,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR},
  36. #{projectStatus,jdbcType=INTEGER}, #{content,jdbcType=VARCHAR}, #{annexUrl,jdbcType=VARCHAR},
  37. #{createTime,jdbcType=TIMESTAMP}, #{processStatus,jdbcType=INTEGER}, #{duration,jdbcType=DOUBLE}
  38. )
  39. </insert>
  40. <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.ruoyi.project.domain.ProjectStaffRecord" useGeneratedKeys="true">
  41. insert into project_staff_record
  42. <trim prefix="(" suffix=")" suffixOverrides=",">
  43. <if test="pid != null">
  44. pid,
  45. </if>
  46. <if test="aid != null">
  47. aid,
  48. </if>
  49. <if test="name != null">
  50. `name`,
  51. </if>
  52. <if test="projectStatus != null">
  53. project_status,
  54. </if>
  55. <if test="content != null">
  56. content,
  57. </if>
  58. <if test="annexUrl != null">
  59. annex_url,
  60. </if>
  61. <if test="createTime != null">
  62. create_time,
  63. </if>
  64. <if test="processStatus != null">
  65. process_status,
  66. </if>
  67. <if test="duration != null">
  68. duration,
  69. </if>
  70. </trim>
  71. <trim prefix="values (" suffix=")" suffixOverrides=",">
  72. <if test="pid != null">
  73. #{pid,jdbcType=BIGINT},
  74. </if>
  75. <if test="aid != null">
  76. #{aid,jdbcType=BIGINT},
  77. </if>
  78. <if test="name != null">
  79. #{name,jdbcType=VARCHAR},
  80. </if>
  81. <if test="projectStatus != null">
  82. #{projectStatus,jdbcType=INTEGER},
  83. </if>
  84. <if test="content != null">
  85. #{content,jdbcType=VARCHAR},
  86. </if>
  87. <if test="annexUrl != null">
  88. #{annexUrl,jdbcType=VARCHAR},
  89. </if>
  90. <if test="createTime != null">
  91. #{createTime,jdbcType=TIMESTAMP},
  92. </if>
  93. <if test="processStatus != null">
  94. #{processStatus,jdbcType=INTEGER},
  95. </if>
  96. <if test="duration != null">
  97. #{duration,jdbcType=DOUBLE},
  98. </if>
  99. </trim>
  100. </insert>
  101. <update id="updateByPrimaryKeySelective" parameterType="com.ruoyi.project.domain.ProjectStaffRecord">
  102. update project_staff_record
  103. <set>
  104. <if test="pid != null">
  105. pid = #{pid,jdbcType=BIGINT},
  106. </if>
  107. <if test="aid != null">
  108. aid = #{aid,jdbcType=BIGINT},
  109. </if>
  110. <if test="name != null">
  111. `name` = #{name,jdbcType=VARCHAR},
  112. </if>
  113. <if test="projectStatus != null">
  114. project_status = #{projectStatus,jdbcType=INTEGER},
  115. </if>
  116. <if test="content != null">
  117. content = #{content,jdbcType=VARCHAR},
  118. </if>
  119. <if test="annexUrl != null">
  120. annex_url = #{annexUrl,jdbcType=VARCHAR},
  121. </if>
  122. <if test="createTime != null">
  123. create_time = #{createTime,jdbcType=TIMESTAMP},
  124. </if>
  125. <if test="processStatus != null">
  126. process_status = #{processStatus,jdbcType=INTEGER},
  127. </if>
  128. <if test="duration != null">
  129. duration = #{duration,jdbcType=DOUBLE},
  130. </if>
  131. </set>
  132. where id = #{id,jdbcType=BIGINT}
  133. </update>
  134. <update id="updateByPrimaryKey" parameterType="com.ruoyi.project.domain.ProjectStaffRecord">
  135. update project_staff_record
  136. set pid = #{pid,jdbcType=BIGINT},
  137. aid = #{aid,jdbcType=BIGINT},
  138. `name` = #{name,jdbcType=VARCHAR},
  139. project_status = #{projectStatus,jdbcType=INTEGER},
  140. content = #{content,jdbcType=VARCHAR},
  141. annex_url = #{annexUrl,jdbcType=VARCHAR},
  142. create_time = #{createTime,jdbcType=TIMESTAMP},
  143. process_status = #{processStatus,jdbcType=INTEGER},
  144. duration = #{duration,jdbcType=DOUBLE}
  145. where id = #{id,jdbcType=BIGINT}
  146. </update>
  147. <select id="selectList" resultType="com.ruoyi.project.bo.ProjectStaffRecordOut">
  148. select a.id,a.pid ,a.aid ,a.name ,a.project_status projectStatus,a.content ,
  149. a.annex_url annexUrl,a.create_time createTimeStr,a.process_status processStatus ,
  150. a.duration
  151. from project_staff_record a left join project_task b on a.pid=b.id
  152. where 1=1
  153. <if test="roleId==2">
  154. and a.aid =#{aid}
  155. </if>
  156. <if test="roleId==3">
  157. and b.aid =#{aid}
  158. </if>
  159. </select>
  160. </mapper>