FsIllnessLibraryMapper.xml 4.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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.fs.his.mapper.FsIllnessLibraryMapper">
  6. <resultMap type="FsIllnessLibrary" id="FsIllnessLibraryResult">
  7. <result property="illnessId" column="illness_id" />
  8. <result property="illnessName" column="illness_name" />
  9. <result property="symptom" column="symptom" />
  10. <result property="tongueVein" column="tongue_vein" />
  11. <result property="therapy" column="therapy" />
  12. <result property="formulaName" column="formula_name" />
  13. <result property="formulaDescs" column="Formula_descs" />
  14. </resultMap>
  15. <sql id="selectFsIllnessLibraryVo">
  16. select illness_id, illness_name, symptom, tongue_vein, therapy, formula_name, Formula_descs from fs_illness_library
  17. </sql>
  18. <select id="selectFsIllnessLibraryList" parameterType="FsIllnessLibrary" resultMap="FsIllnessLibraryResult">
  19. <include refid="selectFsIllnessLibraryVo"/>
  20. <where>
  21. <if test="illnessName != null and illnessName != ''"> and illness_name like concat('%', #{illnessName}, '%')</if>
  22. <if test="formulaName != null and formulaName != ''"> and formula_name like concat('%', #{formulaName}, '%')</if>
  23. </where>
  24. </select>
  25. <select id="selectFsIllnessLibraryByIllnessId" parameterType="Long" resultMap="FsIllnessLibraryResult">
  26. <include refid="selectFsIllnessLibraryVo"/>
  27. where illness_id = #{illnessId}
  28. </select>
  29. <insert id="insertFsIllnessLibrary" parameterType="FsIllnessLibrary">
  30. insert into fs_illness_library
  31. <trim prefix="(" suffix=")" suffixOverrides=",">
  32. <if test="illnessId != null">illness_id,</if>
  33. <if test="illnessName != null and illnessName != ''">illness_name,</if>
  34. <if test="symptom != null and symptom != ''">symptom,</if>
  35. <if test="tongueVein != null and tongueVein != ''">tongue_vein,</if>
  36. <if test="therapy != null and therapy != ''">therapy,</if>
  37. <if test="formulaName != null and formulaName != ''">formula_name,</if>
  38. <if test="formulaDescs != null and formulaDescs != ''">Formula_descs,</if>
  39. </trim>
  40. <trim prefix="values (" suffix=")" suffixOverrides=",">
  41. <if test="illnessId != null">#{illnessId},</if>
  42. <if test="illnessName != null and illnessName != ''">#{illnessName},</if>
  43. <if test="symptom != null and symptom != ''">#{symptom},</if>
  44. <if test="tongueVein != null and tongueVein != ''">#{tongueVein},</if>
  45. <if test="therapy != null and therapy != ''">#{therapy},</if>
  46. <if test="formulaName != null and formulaName != ''">#{formulaName},</if>
  47. <if test="formulaDescs != null and formulaDescs != ''">#{formulaDescs},</if>
  48. </trim>
  49. </insert>
  50. <update id="updateFsIllnessLibrary" parameterType="FsIllnessLibrary">
  51. update fs_illness_library
  52. <trim prefix="SET" suffixOverrides=",">
  53. <if test="illnessName != null and illnessName != ''">illness_name = #{illnessName},</if>
  54. <if test="symptom != null and symptom != ''">symptom = #{symptom},</if>
  55. <if test="tongueVein != null and tongueVein != ''">tongue_vein = #{tongueVein},</if>
  56. <if test="therapy != null and therapy != ''">therapy = #{therapy},</if>
  57. <if test="formulaName != null and formulaName != ''">formula_name = #{formulaName},</if>
  58. <if test="formulaDescs != null and formulaDescs != ''">Formula_descs = #{formulaDescs},</if>
  59. </trim>
  60. where illness_id = #{illnessId}
  61. </update>
  62. <delete id="deleteFsIllnessLibraryByIllnessId" parameterType="Long">
  63. delete from fs_illness_library where illness_id = #{illnessId}
  64. </delete>
  65. <delete id="deleteFsIllnessLibraryByIllnessIds" parameterType="String">
  66. delete from fs_illness_library where illness_id in
  67. <foreach item="illnessId" collection="array" open="(" separator="," close=")">
  68. #{illnessId}
  69. </foreach>
  70. </delete>
  71. </mapper>