BdglExamineMapper.xml 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  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.BdglExamineMapper">
  6. <resultMap type="BdglExamine" id="BdglExamineResult">
  7. <result property="id" column="id" />
  8. <result property="unitId" column="unit_id" />
  9. <result property="peopleId" column="people_id" />
  10. <result property="job" column="job" />
  11. <result property="classId" column="class_id" />
  12. <result property="createtime" column="createtime" />
  13. <result property="checkInformation" column="check_information" />
  14. <result property="peopleName" column="people_name" />
  15. <result property="yeardate" column="yeardate" />
  16. <result property="unitName" column="unit_name" />
  17. <result property="type" column="type" />
  18. <result property="age" column="age" />
  19. <result property="idMunber" column="id_munber" />
  20. <result property="fileName" column="file_name" />
  21. <result property="filePath" column="file_path" />
  22. </resultMap>
  23. <sql id="selectBdglExamineVo">
  24. select id, unit_id, people_id, job, class_id, createtime, check_information, people_name, yeardate, unit_name, type, age, id_munber, file_name, file_path from bdgl_examine
  25. </sql>
  26. <select id="selectBdglExamineList" parameterType="BdglExamine" resultMap="BdglExamineResult">
  27. <include refid="selectBdglExamineVo"/>
  28. <where>
  29. <if test="unitId != null "> and unit_id = #{unitId}</if>
  30. <if test="peopleId != null "> and people_id = #{peopleId}</if>
  31. <if test="job != null and job != ''"> and job = #{job}</if>
  32. <if test="classId != null "> and class_id = #{classId}</if>
  33. <if test="createtime != null "> and createtime = #{createtime}</if>
  34. <if test="checkInformation != null and checkInformation != ''"> and check_information = #{checkInformation}</if>
  35. <if test="peopleName != null and peopleName != ''"> and people_name like concat('%', #{peopleName}, '%')</if>
  36. <if test="yeardate != null and yeardate != ''"> and yeardate = #{yeardate}</if>
  37. <if test="unitName != null and unitName != ''"> and unit_name like concat('%', #{unitName}, '%')</if>
  38. <if test="type != null and type != ''"> and type = #{type}</if>
  39. <if test="idMunber != null and idMunber != ''"> and id_munber = #{idMunber}</if>
  40. <if test="minAge !=null">
  41. and age <![CDATA[ >= ]]> #{minAge} and age <![CDATA[ <= ]]> #{maxAge}
  42. </if>
  43. <if test="fileName != null and fileName != ''"> and file_name like concat('%', #{fileName}, '%')</if>
  44. <if test="filePath != null and filePath != ''"> and file_path = #{filePath}</if>
  45. </where>
  46. order by id desc
  47. </select>
  48. <select id="selectBdglExamineById" parameterType="Integer" resultMap="BdglExamineResult">
  49. <include refid="selectBdglExamineVo"/>
  50. where id = #{id}
  51. </select>
  52. <insert id="insertBdglExamine" parameterType="BdglExamine" useGeneratedKeys="true" keyProperty="id">
  53. insert into bdgl_examine
  54. <trim prefix="(" suffix=")" suffixOverrides=",">
  55. <if test="unitId != null">unit_id,</if>
  56. <if test="peopleId != null">people_id,</if>
  57. <if test="job != null">job,</if>
  58. <if test="classId != null">class_id,</if>
  59. <if test="createtime != null">createtime,</if>
  60. <if test="checkInformation != null">check_information,</if>
  61. <if test="peopleName != null">people_name,</if>
  62. <if test="yeardate != null">yeardate,</if>
  63. <if test="unitName != null">unit_name,</if>
  64. <if test="type != null">type,</if>
  65. <if test="age != null">age,</if>
  66. <if test="idMunber != null">id_munber,</if>
  67. <if test="fileName != null">file_name,</if>
  68. <if test="filePath != null">file_path,</if>
  69. </trim>
  70. <trim prefix="values (" suffix=")" suffixOverrides=",">
  71. <if test="unitId != null">#{unitId},</if>
  72. <if test="peopleId != null">#{peopleId},</if>
  73. <if test="job != null">#{job},</if>
  74. <if test="classId != null">#{classId},</if>
  75. <if test="createtime != null">#{createtime},</if>
  76. <if test="checkInformation != null">#{checkInformation},</if>
  77. <if test="peopleName != null">#{peopleName},</if>
  78. <if test="yeardate != null">#{yeardate},</if>
  79. <if test="unitName != null">#{unitName},</if>
  80. <if test="type != null">#{type},</if>
  81. <if test="age != null">#{age},</if>
  82. <if test="idMunber != null">#{idMunber},</if>
  83. <if test="fileName != null">#{fileName},</if>
  84. <if test="filePath != null">#{filePath},</if>
  85. </trim>
  86. </insert>
  87. <update id="updateBdglExamine" parameterType="BdglExamine">
  88. update bdgl_examine
  89. <trim prefix="SET" suffixOverrides=",">
  90. <if test="unitId != null">unit_id = #{unitId},</if>
  91. <if test="peopleId != null">people_id = #{peopleId},</if>
  92. <if test="job != null">job = #{job},</if>
  93. <if test="classId != null">class_id = #{classId},</if>
  94. <if test="createtime != null">createtime = #{createtime},</if>
  95. <if test="checkInformation != null">check_information = #{checkInformation},</if>
  96. <if test="peopleName != null">people_name = #{peopleName},</if>
  97. <if test="yeardate != null">yeardate = #{yeardate},</if>
  98. <if test="unitName != null">unit_name = #{unitName},</if>
  99. <if test="type != null">type = #{type},</if>
  100. <if test="age != null">age = #{age},</if>
  101. <if test="idMunber != null">id_munber = #{idMunber},</if>
  102. <if test="fileName != null">file_name = #{fileName},</if>
  103. <if test="filePath != null">file_path = #{filePath},</if>
  104. </trim>
  105. where id = #{id}
  106. </update>
  107. <delete id="deleteBdglExamineById" parameterType="Integer">
  108. delete from bdgl_examine where id = #{id}
  109. </delete>
  110. <delete id="deleteBdglExamineByIds" parameterType="String">
  111. delete from bdgl_examine where id in
  112. <foreach item="id" collection="array" open="(" separator="," close=")">
  113. #{id}
  114. </foreach>
  115. </delete>
  116. </mapper>