BdglDiagnoseMapper.xml 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  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.BdglDiagnoseMapper">
  6. <resultMap type="BdglDiagnose" id="BdglDiagnoseResult">
  7. <result property="id" column="id" />
  8. <result property="unitId" column="unit_id" />
  9. <result property="peopleId" column="people_id" />
  10. <result property="address" column="address" />
  11. <result property="startTime" column="start_time" />
  12. <result property="duration" column="duration" />
  13. <result property="endTime" column="end_time" />
  14. <result property="adminId" column="admin_id" />
  15. <result property="createtime" column="createtime" />
  16. <result property="updatetime" column="updatetime" />
  17. <result property="illness" column="illness" />
  18. <result property="unitName" column="unit_name" />
  19. <result property="peopleName" column="people_name" />
  20. <result property="adminname" column="adminname" />
  21. <result property="accompanyingPerson" column="accompanying_person" />
  22. <result property="state" column="state" />
  23. </resultMap>
  24. <sql id="selectBdglDiagnoseVo">
  25. select id, unit_id, people_id, address, start_time, duration, end_time, admin_id, createtime, updatetime, illness, unit_name, people_name, adminname, accompanying_person, state from bdgl_diagnose
  26. </sql>
  27. <select id="selectBdglDiagnoseList" parameterType="BdglDiagnose" resultMap="BdglDiagnoseResult">
  28. <include refid="selectBdglDiagnoseVo"/>
  29. <where>
  30. <if test="unitId != null "> and unit_id = #{unitId}</if>
  31. <if test="peopleId != null "> and people_id = #{peopleId}</if>
  32. <if test="address != null and address != ''"> and address = #{address}</if>
  33. <if test="startTime != null "> and start_time = #{startTime}</if>
  34. <if test="duration != null and duration != ''"> and duration = #{duration}</if>
  35. <if test="endTime != null "> and end_time = #{endTime}</if>
  36. <if test="adminId != null "> and admin_id = #{adminId}</if>
  37. <if test="createtime != null and createtime != ''"> and createtime = #{createtime}</if>
  38. <if test="updatetime != null and updatetime != ''"> and updatetime = #{updatetime}</if>
  39. <if test="illness != null and illness != ''"> and illness = #{illness}</if>
  40. <if test="unitName != null and unitName != ''"> and unit_name like concat('%', #{unitName}, '%')</if>
  41. <if test="peopleName != null and peopleName != ''"> and people_name like concat('%', #{peopleName}, '%')</if>
  42. <if test="adminname != null and adminname != ''"> and adminname like concat('%', #{adminname}, '%')</if>
  43. <if test="accompanyingPerson != null and accompanyingPerson != ''"> and accompanying_person = #{accompanyingPerson}</if>
  44. <if test="state != null and state != ''"> and state = #{state}</if>
  45. </where>
  46. </select>
  47. <select id="selectBdglDiagnoseById" parameterType="Integer" resultMap="BdglDiagnoseResult">
  48. <include refid="selectBdglDiagnoseVo"/>
  49. where id = #{id}
  50. </select>
  51. <insert id="insertBdglDiagnose" parameterType="BdglDiagnose" useGeneratedKeys="true" keyProperty="id">
  52. insert into bdgl_diagnose
  53. <trim prefix="(" suffix=")" suffixOverrides=",">
  54. <if test="unitId != null">unit_id,</if>
  55. <if test="peopleId != null">people_id,</if>
  56. <if test="address != null">address,</if>
  57. <if test="startTime != null">start_time,</if>
  58. <if test="duration != null">duration,</if>
  59. <if test="endTime != null">end_time,</if>
  60. <if test="adminId != null">admin_id,</if>
  61. <if test="createtime != null">createtime,</if>
  62. <if test="updatetime != null">updatetime,</if>
  63. <if test="illness != null">illness,</if>
  64. <if test="unitName != null">unit_name,</if>
  65. <if test="peopleName != null">people_name,</if>
  66. <if test="adminname != null">adminname,</if>
  67. <if test="accompanyingPerson != null">accompanying_person,</if>
  68. <if test="state != null">state,</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="address != null">#{address},</if>
  74. <if test="startTime != null">#{startTime},</if>
  75. <if test="duration != null">#{duration},</if>
  76. <if test="endTime != null">#{endTime},</if>
  77. <if test="adminId != null">#{adminId},</if>
  78. <if test="createtime != null">#{createtime},</if>
  79. <if test="updatetime != null">#{updatetime},</if>
  80. <if test="illness != null">#{illness},</if>
  81. <if test="unitName != null">#{unitName},</if>
  82. <if test="peopleName != null">#{peopleName},</if>
  83. <if test="adminname != null">#{adminname},</if>
  84. <if test="accompanyingPerson != null">#{accompanyingPerson},</if>
  85. <if test="state != null">#{state},</if>
  86. </trim>
  87. </insert>
  88. <update id="updateBdglDiagnose" parameterType="BdglDiagnose">
  89. update bdgl_diagnose
  90. <trim prefix="SET" suffixOverrides=",">
  91. <if test="unitId != null">unit_id = #{unitId},</if>
  92. <if test="peopleId != null">people_id = #{peopleId},</if>
  93. <if test="address != null">address = #{address},</if>
  94. <if test="startTime != null">start_time = #{startTime},</if>
  95. <if test="duration != null">duration = #{duration},</if>
  96. <if test="endTime != null">end_time = #{endTime},</if>
  97. <if test="adminId != null">admin_id = #{adminId},</if>
  98. <if test="createtime != null">createtime = #{createtime},</if>
  99. <if test="updatetime != null">updatetime = #{updatetime},</if>
  100. <if test="illness != null">illness = #{illness},</if>
  101. <if test="unitName != null">unit_name = #{unitName},</if>
  102. <if test="peopleName != null">people_name = #{peopleName},</if>
  103. <if test="adminname != null">adminname = #{adminname},</if>
  104. <if test="accompanyingPerson != null">accompanying_person = #{accompanyingPerson},</if>
  105. <if test="state != null">state = #{state},</if>
  106. </trim>
  107. where id = #{id}
  108. </update>
  109. <delete id="deleteBdglDiagnoseById" parameterType="Integer">
  110. delete from bdgl_diagnose where id = #{id}
  111. </delete>
  112. <delete id="deleteBdglDiagnoseByIds" parameterType="String">
  113. delete from bdgl_diagnose where id in
  114. <foreach item="id" collection="array" open="(" separator="," close=")">
  115. #{id}
  116. </foreach>
  117. </delete>
  118. </mapper>