BdglExamineDetailsMapper.xml 4.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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.medicalhealth.mapper.BdglExamineDetailsMapper">
  6. <resultMap type="BdglExamineDetails" id="BdglExamineDetailsResult">
  7. <result property="id" column="id" />
  8. <result property="year" column="year" />
  9. <result property="contents" column="contents" />
  10. <result property="examineId" column="examine_id" />
  11. <result property="fileName" column="file_name" />
  12. <result property="filePath" column="file_path" />
  13. <result property="month" column="month" />
  14. <result property="createTime" column="create_time" />
  15. </resultMap>
  16. <sql id="selectBdglExamineDetailsVo">
  17. select id, year, contents, examine_id, file_name, file_path, month, create_time from bdgl_examine_details
  18. </sql>
  19. <select id="selectBdglExamineDetailsList" parameterType="BdglExamineDetails" resultMap="BdglExamineDetailsResult">
  20. <include refid="selectBdglExamineDetailsVo"/>
  21. <where>
  22. <if test="year != null and year != ''"> and year = #{year}</if>
  23. <if test="contents != null and contents != ''"> and contents = #{contents}</if>
  24. <if test="examineId != null "> and examine_id = #{examineId}</if>
  25. <if test="fileName != null and fileName != ''"> and file_name like concat('%', #{fileName}, '%')</if>
  26. <if test="filePath != null and filePath != ''"> and file_path = #{filePath}</if>
  27. <if test="month != null and month != ''"> and month = #{month}</if>
  28. </where>
  29. </select>
  30. <select id="selectBdglExamineDetailsById" parameterType="Integer" resultMap="BdglExamineDetailsResult">
  31. <include refid="selectBdglExamineDetailsVo"/>
  32. where id = #{id}
  33. </select>
  34. <insert id="insertBdglExamineDetails" parameterType="BdglExamineDetails" useGeneratedKeys="true" keyProperty="id">
  35. insert into bdgl_examine_details
  36. <trim prefix="(" suffix=")" suffixOverrides=",">
  37. <if test="year != null">year,</if>
  38. <if test="contents != null">contents,</if>
  39. <if test="examineId != null">examine_id,</if>
  40. <if test="fileName != null">file_name,</if>
  41. <if test="filePath != null">file_path,</if>
  42. <if test="month != null">month,</if>
  43. <if test="createTime != null">create_time,</if>
  44. </trim>
  45. <trim prefix="values (" suffix=")" suffixOverrides=",">
  46. <if test="year != null">#{year},</if>
  47. <if test="contents != null">#{contents},</if>
  48. <if test="examineId != null">#{examineId},</if>
  49. <if test="fileName != null">#{fileName},</if>
  50. <if test="filePath != null">#{filePath},</if>
  51. <if test="month != null">#{month},</if>
  52. <if test="createTime != null">#{createTime},</if>
  53. </trim>
  54. </insert>
  55. <update id="updateBdglExamineDetails" parameterType="BdglExamineDetails">
  56. update bdgl_examine_details
  57. <trim prefix="SET" suffixOverrides=",">
  58. <if test="year != null">year = #{year},</if>
  59. <if test="contents != null">contents = #{contents},</if>
  60. <if test="examineId != null">examine_id = #{examineId},</if>
  61. <if test="fileName != null">file_name = #{fileName},</if>
  62. <if test="filePath != null">file_path = #{filePath},</if>
  63. <if test="month != null">month = #{month},</if>
  64. <if test="createTime != null">create_time = #{createTime},</if>
  65. </trim>
  66. where id = #{id}
  67. </update>
  68. <delete id="deleteBdglExamineDetailsById" parameterType="Integer">
  69. delete from bdgl_examine_details where id = #{id}
  70. </delete>
  71. <delete id="deleteBdglExamineDetailsByIds" parameterType="String">
  72. delete from bdgl_examine_details where id in
  73. <foreach item="id" collection="array" open="(" separator="," close=")">
  74. #{id}
  75. </foreach>
  76. </delete>
  77. </mapper>