TUploadhistoryMapper.xml 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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.system.mapper.TUploadhistoryMapper">
  6. <resultMap type="TUploadhistory" id="TUploadhistoryResult">
  7. <result property="id" column="id" />
  8. <result property="uploadCode" column="upload_code" />
  9. <result property="uploadDate" column="upload_date" />
  10. <result property="uploadType" column="upload_type" />
  11. <result property="content" column="content" />
  12. <result property="deptId" column="dept_id" />
  13. <result property="deptName" column="dept_name" />
  14. </resultMap>
  15. <sql id="selectTUploadhistoryVo">
  16. select d.id, d.upload_code, d.upload_date, d.upload_type, d.content, d.dept_id ,s.dept_name from t_uploadhistory d
  17. left join sys_dept s on s.dept_id = d.dept_id
  18. </sql>
  19. <select id="selectTUploadhistoryList" parameterType="TUploadhistory" resultMap="TUploadhistoryResult">
  20. <include refid="selectTUploadhistoryVo"/>
  21. <where>
  22. <if test="uploadCode != null and uploadCode != ''"> and upload_code = #{uploadCode}</if>
  23. <if test="uploadDate != null "> and upload_date = #{uploadDate}</if>
  24. <if test="uploadType != null and uploadType != ''"> and upload_type = #{uploadType}</if>
  25. <if test="content != null and content != ''"> and content = #{content}</if>
  26. <if test="deptId != null "> and dept_id = #{deptId}</if>
  27. </where>
  28. <!-- 数据范围过滤 -->
  29. ${params.dataScope}
  30. </select>
  31. <select id="selectTUploadhistoryById" parameterType="Long" resultMap="TUploadhistoryResult">
  32. <include refid="selectTUploadhistoryVo"/>
  33. where id = #{id}
  34. </select>
  35. <insert id="insertTUploadhistory" parameterType="TUploadhistory">
  36. <selectKey keyProperty="id" resultType="long" order="BEFORE">
  37. SELECT seq_t_uploadhistory.NEXTVAL as id FROM DUAL
  38. </selectKey>
  39. insert into t_uploadhistory
  40. <trim prefix="(" suffix=")" suffixOverrides=",">
  41. <if test="id != null">id,</if>
  42. <if test="uploadCode != null">upload_code,</if>
  43. <if test="uploadDate != null">upload_date,</if>
  44. <if test="uploadType != null">upload_type,</if>
  45. <if test="content != null">content,</if>
  46. <if test="deptId != null">dept_id,</if>
  47. </trim>
  48. <trim prefix="values (" suffix=")" suffixOverrides=",">
  49. <if test="id != null">#{id},</if>
  50. <if test="uploadCode != null">#{uploadCode},</if>
  51. <if test="uploadDate != null">#{uploadDate},</if>
  52. <if test="uploadType != null">#{uploadType},</if>
  53. <if test="content != null">#{content},</if>
  54. <if test="deptId != null">#{deptId},</if>
  55. </trim>
  56. </insert>
  57. <update id="updateTUploadhistory" parameterType="TUploadhistory">
  58. update t_uploadhistory
  59. <trim prefix="SET" suffixOverrides=",">
  60. <if test="uploadCode != null">upload_code = #{uploadCode},</if>
  61. <if test="uploadDate != null">upload_date = #{uploadDate},</if>
  62. <if test="uploadType != null">upload_type = #{uploadType},</if>
  63. <if test="content != null">content = #{content},</if>
  64. <if test="deptId != null">dept_id = #{deptId},</if>
  65. </trim>
  66. where id = #{id}
  67. </update>
  68. </mapper>