UserRecordMapper.xml 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  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.system.mapper.UserRecordMapper">
  6. <resultMap id="BaseResultMap" type="com.ruoyi.system.domain.UserRecord">
  7. <id property="id" column="id" jdbcType="BIGINT"/>
  8. <result property="ddUserId" column="dd_user_id" jdbcType="BIGINT"/>
  9. <result property="psrId" column="psr_id" jdbcType="BIGINT"/>
  10. <result property="name" column="name" jdbcType="VARCHAR"/>
  11. <result property="status" column="status" jdbcType="INTEGER"/>
  12. <result property="clockStatus" column="clock_status" jdbcType="INTEGER"/>
  13. <result property="content" column="content" jdbcType="VARCHAR"/>
  14. <result property="recordTime" column="record_time" jdbcType="TIMESTAMP"/>
  15. <result property="startTime" column="start_time" jdbcType="TIMESTAMP"/>
  16. <result property="endTime" column="end_time" jdbcType="TIMESTAMP"/>
  17. <result property="sumDuration" column="sum_duration" jdbcType="DOUBLE"/>
  18. <result property="checkDuration" column="check_duration" jdbcType="DOUBLE"/>
  19. <result property="createId" column="create_id" jdbcType="BIGINT"/>
  20. </resultMap>
  21. <sql id="Base_Column_List">
  22. id,dd_user_id,psr_id,
  23. name,status,clock_status,
  24. content,record_time,start_time,
  25. end_time,sum_duration,check_duration,
  26. create_id
  27. </sql>
  28. <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
  29. select
  30. <include refid="Base_Column_List" />
  31. from user_record
  32. where id = #{id,jdbcType=BIGINT}
  33. </select>
  34. <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
  35. delete from user_record
  36. where id = #{id,jdbcType=BIGINT}
  37. </delete>
  38. <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.ruoyi.system.domain.UserRecord" useGeneratedKeys="true">
  39. insert into user_record
  40. ( id,dd_user_id,psr_id
  41. ,name,status,clock_status
  42. ,content,record_time,start_time
  43. ,end_time,sum_duration,check_duration
  44. ,create_id)
  45. values (#{id,jdbcType=BIGINT},#{ddUserId,jdbcType=BIGINT},#{psrId,jdbcType=BIGINT}
  46. ,#{name,jdbcType=VARCHAR},#{status,jdbcType=INTEGER},#{clockStatus,jdbcType=INTEGER}
  47. ,#{content,jdbcType=VARCHAR},#{recordTime,jdbcType=TIMESTAMP},#{startTime,jdbcType=TIMESTAMP}
  48. ,#{endTime,jdbcType=TIMESTAMP},#{sumDuration,jdbcType=DOUBLE},#{checkDuration,jdbcType=DOUBLE}
  49. ,#{createId,jdbcType=BIGINT})
  50. </insert>
  51. <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.ruoyi.system.domain.UserRecord" useGeneratedKeys="true">
  52. insert into user_record
  53. <trim prefix="(" suffix=")" suffixOverrides=",">
  54. <if test="id != null">id,</if>
  55. <if test="ddUserId != null">dd_user_id,</if>
  56. <if test="psrId != null">psr_id,</if>
  57. <if test="name != null">name,</if>
  58. <if test="status != null">status,</if>
  59. <if test="clockStatus != null">clock_status,</if>
  60. <if test="content != null">content,</if>
  61. <if test="recordTime != null">record_time,</if>
  62. <if test="startTime != null">start_time,</if>
  63. <if test="endTime != null">end_time,</if>
  64. <if test="sumDuration != null">sum_duration,</if>
  65. <if test="checkDuration != null">check_duration,</if>
  66. <if test="createId != null">create_id,</if>
  67. </trim>
  68. <trim prefix="values (" suffix=")" suffixOverrides=",">
  69. <if test="id != null">#{id,jdbcType=BIGINT},</if>
  70. <if test="ddUserId != null">#{ddUserId,jdbcType=BIGINT},</if>
  71. <if test="psrId != null">#{psrId,jdbcType=BIGINT},</if>
  72. <if test="name != null">#{name,jdbcType=VARCHAR},</if>
  73. <if test="status != null">#{status,jdbcType=INTEGER},</if>
  74. <if test="clockStatus != null">#{clockStatus,jdbcType=INTEGER},</if>
  75. <if test="content != null">#{content,jdbcType=VARCHAR},</if>
  76. <if test="recordTime != null">#{recordTime,jdbcType=TIMESTAMP},</if>
  77. <if test="startTime != null">#{startTime,jdbcType=TIMESTAMP},</if>
  78. <if test="endTime != null">#{endTime,jdbcType=TIMESTAMP},</if>
  79. <if test="sumDuration != null">#{sumDuration,jdbcType=DOUBLE},</if>
  80. <if test="checkDuration != null">#{checkDuration,jdbcType=DOUBLE},</if>
  81. <if test="createId != null">#{createId,jdbcType=BIGINT},</if>
  82. </trim>
  83. </insert>
  84. <update id="updateByPrimaryKeySelective" parameterType="com.ruoyi.system.domain.UserRecord">
  85. update user_record
  86. <set>
  87. <if test="ddUserId != null">
  88. dd_user_id = #{ddUserId,jdbcType=BIGINT},
  89. </if>
  90. <if test="psrId != null">
  91. psr_id = #{psrId,jdbcType=BIGINT},
  92. </if>
  93. <if test="name != null">
  94. name = #{name,jdbcType=VARCHAR},
  95. </if>
  96. <if test="status != null">
  97. status = #{status,jdbcType=INTEGER},
  98. </if>
  99. <if test="clockStatus != null">
  100. clock_status = #{clockStatus,jdbcType=INTEGER},
  101. </if>
  102. <if test="content != null">
  103. content = #{content,jdbcType=VARCHAR},
  104. </if>
  105. <if test="recordTime != null">
  106. record_time = #{recordTime,jdbcType=TIMESTAMP},
  107. </if>
  108. <if test="startTime != null">
  109. start_time = #{startTime,jdbcType=TIMESTAMP},
  110. </if>
  111. <if test="endTime != null">
  112. end_time = #{endTime,jdbcType=TIMESTAMP},
  113. </if>
  114. <if test="sumDuration != null">
  115. sum_duration = #{sumDuration,jdbcType=DOUBLE},
  116. </if>
  117. <if test="checkDuration != null">
  118. check_duration = #{checkDuration,jdbcType=DOUBLE},
  119. </if>
  120. <if test="createId != null">
  121. create_id = #{createId,jdbcType=BIGINT},
  122. </if>
  123. </set>
  124. where id = #{id,jdbcType=BIGINT}
  125. </update>
  126. <update id="updateByPrimaryKey" parameterType="com.ruoyi.system.domain.UserRecord">
  127. update user_record
  128. set
  129. dd_user_id = #{ddUserId,jdbcType=BIGINT},
  130. psr_id = #{psrId,jdbcType=BIGINT},
  131. name = #{name,jdbcType=VARCHAR},
  132. status = #{status,jdbcType=INTEGER},
  133. clock_status = #{clockStatus,jdbcType=INTEGER},
  134. content = #{content,jdbcType=VARCHAR},
  135. record_time = #{recordTime,jdbcType=TIMESTAMP},
  136. start_time = #{startTime,jdbcType=TIMESTAMP},
  137. end_time = #{endTime,jdbcType=TIMESTAMP},
  138. sum_duration = #{sumDuration,jdbcType=DOUBLE},
  139. check_duration = #{checkDuration,jdbcType=DOUBLE},
  140. create_id = #{createId,jdbcType=BIGINT}
  141. where id = #{id,jdbcType=BIGINT}
  142. </update>
  143. <resultMap id="OutMap" type="com.ruoyi.system.domain.UserRecordOut">
  144. <id property="id" column="id" jdbcType="BIGINT"/>
  145. <result property="ddUserId" column="dd_user_id" jdbcType="BIGINT"/>
  146. <result property="psrId" column="psr_id" jdbcType="BIGINT"/>
  147. <result property="name" column="name" jdbcType="VARCHAR"/>
  148. <result property="status" column="status" jdbcType="INTEGER"/>
  149. <result property="clockStatus" column="clock_status" jdbcType="INTEGER"/>
  150. <result property="content" column="content" jdbcType="VARCHAR"/>
  151. <result property="recordTime" column="record_time" jdbcType="TIMESTAMP"/>
  152. <result property="startTime" column="start_time" jdbcType="TIMESTAMP"/>
  153. <result property="endTime" column="end_time" jdbcType="TIMESTAMP"/>
  154. <result property="sumDuration" column="sum_duration" jdbcType="DOUBLE"/>
  155. <result property="checkDuration" column="check_duration" jdbcType="DOUBLE"/>
  156. <result property="duration" column="duration" jdbcType="DOUBLE"/>
  157. <result property="createId" column="create_id" jdbcType="BIGINT"/>
  158. </resultMap>
  159. <select id="selectUserClock" resultMap="OutMap">
  160. select
  161. a.id,a.dd_user_id, a.psr_id, a.name, a.status,a.clock_status, a.content, a.record_time, a.start_time, a.end_time,
  162. a.sum_duration, a.check_duration, a.create_id,
  163. b.duration
  164. from user_record a left join project_staff_record b on a.psr_id=b.id
  165. where a.create_id= #{userId,jdbcType=BIGINT}
  166. <if test="status != null">
  167. and a.status = #{status,jdbcType=INTEGER}
  168. </if>
  169. </select>
  170. </mapper>