FsFamousPrescribeMapper.xml 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  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.FsFamousPrescribeMapper">
  6. <resultMap type="FsFamousPrescribe" id="FsFamousPrescribeResult">
  7. <result property="id" column="id" />
  8. <result property="prescribeName" column="prescribe_name" />
  9. <result property="imgUrl" column="img_url" />
  10. <result property="sort" column="sort" />
  11. <result property="prescribeType" column="prescribe_type" />
  12. <result property="indication" column="indication" />
  13. <result property="belongBook" column="belong_book" />
  14. <result property="descs" column="descs" />
  15. <result property="action" column="action" />
  16. <result property="usageMethod" column="usage_method" />
  17. <result property="msg" column="msg" />
  18. <result property="createTime" column="create_time" />
  19. <result property="status" column="status" />
  20. <result property="pinyin" column="pinyin" />
  21. <result property="actionTitle" column="action_title" />
  22. </resultMap>
  23. <sql id="selectFsFamousPrescribeVo">
  24. select id, prescribe_name,action_title, img_url,pinyin, sort, prescribe_type, indication, belong_book, descs, action, usage_method, msg, create_time, status from fs_famous_prescribe
  25. </sql>
  26. <select id="selectFsFamousPrescribeList" parameterType="FsFamousPrescribe" resultMap="FsFamousPrescribeResult">
  27. <include refid="selectFsFamousPrescribeVo"/>
  28. <where>
  29. <if test="prescribeName != null and prescribeName != ''"> and prescribe_name like concat('%', #{prescribeName}, '%')</if>
  30. <if test="imgUrl != null and imgUrl != ''"> and img_url = #{imgUrl}</if>
  31. <if test="sort != null "> and sort = #{sort}</if>
  32. <if test="prescribeType != null and prescribeType != ''"> and prescribe_type = #{prescribeType}</if>
  33. <if test="indication != null and indication != ''"> and indication = #{indication}</if>
  34. <if test="belongBook != null and belongBook != ''"> and belong_book = #{belongBook}</if>
  35. <if test="descs != null and descs != ''"> and descs = #{descs}</if>
  36. <if test="action != null and action != ''"> and action = #{action}</if>
  37. <if test="usageMethod != null and usageMethod != ''"> and usage_method = #{usageMethod }</if>
  38. <if test="msg != null and msg != ''"> and msg = #{msg}</if>
  39. <if test="createTime != null "> and create_time = #{createTime}</if>
  40. <if test="status != null "> and status = #{status}</if>
  41. </where>
  42. order by sort,id desc
  43. </select>
  44. <select id="selectFsFamousPrescribeById" parameterType="Long" resultMap="FsFamousPrescribeResult">
  45. <include refid="selectFsFamousPrescribeVo"/>
  46. where id = #{id}
  47. </select>
  48. <insert id="insertFsFamousPrescribe" parameterType="FsFamousPrescribe" useGeneratedKeys="true" keyProperty="id">
  49. insert into fs_famous_prescribe
  50. <trim prefix="(" suffix=")" suffixOverrides=",">
  51. <if test="prescribeName != null and prescribeName != ''">prescribe_name,</if>
  52. <if test="imgUrl != null">img_url,</if>
  53. <if test="sort != null">sort,</if>
  54. <if test="prescribeType != null">prescribe_type,</if>
  55. <if test="indication != null">indication,</if>
  56. <if test="belongBook != null">belong_book,</if>
  57. <if test="descs != null">descs,</if>
  58. <if test="action != null">action,</if>
  59. <if test="usageMethod != null">usage_method,</if>
  60. <if test="msg != null">msg,</if>
  61. <if test="createTime != null">create_time,</if>
  62. <if test="status != null">status,</if>
  63. <if test="pinyin != null">pinyin,</if>
  64. <if test="actionTitle != null">action_title,</if>
  65. </trim>
  66. <trim prefix="values (" suffix=")" suffixOverrides=",">
  67. <if test="prescribeName != null and prescribeName != ''">#{prescribeName},</if>
  68. <if test="imgUrl != null">#{imgUrl},</if>
  69. <if test="sort != null">#{sort},</if>
  70. <if test="prescribeType != null">#{prescribeType},</if>
  71. <if test="indication != null">#{indication},</if>
  72. <if test="belongBook != null">#{belongBook},</if>
  73. <if test="descs != null">#{descs},</if>
  74. <if test="action != null">#{action},</if>
  75. <if test="usageMethod != null">#{usageMethod },</if>
  76. <if test="msg != null">#{msg},</if>
  77. <if test="createTime != null">#{createTime},</if>
  78. <if test="status != null">#{status},</if>
  79. <if test="pinyin != null">#{pinyin},</if>
  80. <if test="actionTitle != null">#{actionTitle},</if>
  81. </trim>
  82. </insert>
  83. <update id="updateFsFamousPrescribe" parameterType="FsFamousPrescribe">
  84. update fs_famous_prescribe
  85. <trim prefix="SET" suffixOverrides=",">
  86. <if test="prescribeName != null and prescribeName != ''">prescribe_name = #{prescribeName},</if>
  87. <if test="imgUrl != null">img_url = #{imgUrl},</if>
  88. <if test="sort != null">sort = #{sort},</if>
  89. <if test="prescribeType != null">prescribe_type = #{prescribeType},</if>
  90. <if test="indication != null">indication = #{indication},</if>
  91. <if test="belongBook != null">belong_book = #{belongBook},</if>
  92. <if test="descs != null">descs = #{descs},</if>
  93. <if test="action != null">action = #{action},</if>
  94. <if test="usageMethod != null">usage_method = #{usageMethod },</if>
  95. <if test="msg != null">msg = #{msg},</if>
  96. <if test="createTime != null">create_time = #{createTime},</if>
  97. <if test="status != null">status = #{status},</if>
  98. <if test="pinyin != null">pinyin = #{pinyin},</if>
  99. <if test="actionTitle != null">action_title = #{actionTitle},</if>
  100. </trim>
  101. where id = #{id}
  102. </update>
  103. <delete id="deleteFsFamousPrescribeById" parameterType="Long">
  104. delete from fs_famous_prescribe where id = #{id}
  105. </delete>
  106. <delete id="deleteFsFamousPrescribeByIds" parameterType="String">
  107. delete from fs_famous_prescribe where id in
  108. <foreach item="id" collection="array" open="(" separator="," close=")">
  109. #{id}
  110. </foreach>
  111. </delete>
  112. </mapper>