BdglFileResdMapper.xml 3.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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.supervision.regulations.mapper.BdglFileResdMapper">
  6. <resultMap type="BdglFileResd" id="BdglFileResdResult">
  7. <result property="id" column="id" />
  8. <result property="documentCategory" column="document_category" />
  9. <result property="month" column="month" />
  10. <result property="readNumber" column="read_number" />
  11. <result property="directoryId" column="directory_id" />
  12. </resultMap>
  13. <sql id="selectBdglFileResdVo">
  14. select id, document_category, month, read_number, directory_id from bdgl_file_resd
  15. </sql>
  16. <select id="selectBdglFileResdList" parameterType="BdglFileResd" resultMap="BdglFileResdResult">
  17. <include refid="selectBdglFileResdVo"/>
  18. <where>
  19. <if test="documentCategory != null and documentCategory != ''"> and document_category = #{documentCategory}</if>
  20. <if test="month != null and month != ''"> and month = #{month}</if>
  21. <if test="readNumber != null "> and read_number = #{readNumber}</if>
  22. <if test="directoryId != null "> and directory_id = #{directoryId}</if>
  23. </where>
  24. </select>
  25. <select id="selectBdglFileResdById" parameterType="Long" resultMap="BdglFileResdResult">
  26. <include refid="selectBdglFileResdVo"/>
  27. where id = #{id}
  28. </select>
  29. <select id="selectResdNumber" resultMap="BdglFileResdResult">
  30. <include refid="selectBdglFileResdVo"/>
  31. <where>
  32. <if test="documentCategory != null and documentCategory != ''"> and document_category = #{documentCategory}</if>
  33. <if test="month != null and month != ''"> and month = #{month}</if>
  34. <if test="readNumber != null "> and read_number = #{readNumber}</if>
  35. <if test="directoryId != null "> and directory_id = #{directoryId}</if>
  36. </where>
  37. </select>
  38. <insert id="insertBdglFileResd" parameterType="BdglFileResd" useGeneratedKeys="true" keyProperty="id">
  39. insert into bdgl_file_resd
  40. <trim prefix="(" suffix=")" suffixOverrides=",">
  41. <if test="documentCategory != null">document_category,</if>
  42. <if test="month != null">month,</if>
  43. <if test="readNumber != null">read_number,</if>
  44. <if test="directoryId != null">directory_id,</if>
  45. </trim>
  46. <trim prefix="values (" suffix=")" suffixOverrides=",">
  47. <if test="documentCategory != null">#{documentCategory},</if>
  48. <if test="month != null">#{month},</if>
  49. <if test="readNumber != null">#{readNumber},</if>
  50. <if test="directoryId != null">#{directoryId},</if>
  51. </trim>
  52. </insert>
  53. <update id="updateBdglFileResd" parameterType="BdglFileResd">
  54. update bdgl_file_resd
  55. <trim prefix="SET" suffixOverrides=",">
  56. <if test="documentCategory != null">document_category = #{documentCategory},</if>
  57. <if test="month != null">month = #{month},</if>
  58. <if test="readNumber != null">read_number = #{readNumber},</if>
  59. <if test="directoryId != null">directory_id = #{directoryId},</if>
  60. </trim>
  61. where id = #{id}
  62. </update>
  63. <delete id="deleteBdglFileResdById" parameterType="Long">
  64. delete from bdgl_file_resd where id = #{id}
  65. </delete>
  66. <delete id="deleteBdglFileResdByIds" parameterType="String">
  67. delete from bdgl_file_resd where id in
  68. <foreach item="id" collection="array" open="(" separator="," close=")">
  69. #{id}
  70. </foreach>
  71. </delete>
  72. </mapper>