You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

128 lines
7.5 KiB

  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.chenhai.system.mapper.SysVacInfoMapper">
  6. <resultMap type="SysVacInfo" id="SysVacInfoResult">
  7. <result property="id" column="id" />
  8. <result property="title" column="title" />
  9. <result property="livestockType" column="livestock_type" />
  10. <result property="vaccineType" column="vaccine_type" />
  11. <result property="description" column="description" />
  12. <result property="vaccinationDate" column="vaccination_date" />
  13. <result property="vaccinationLocation" column="vaccination_location" />
  14. <result property="availableSlots" column="available_slots" />
  15. <result property="totalSlots" column="total_slots" />
  16. <result property="status" column="status" />
  17. <result property="publishTime" column="publish_time" />
  18. <result property="endTime" column="end_time" />
  19. <result property="delFlag" column="del_flag" />
  20. <result property="createBy" column="create_by" />
  21. <result property="createTime" column="create_time" />
  22. <result property="updateBy" column="update_by" />
  23. <result property="updateTime" column="update_time" />
  24. <result property="remark" column="remark" />
  25. </resultMap>
  26. <sql id="selectSysVacInfoVo">
  27. select id, title, livestock_type, vaccine_type, description, vaccination_date, vaccination_location, available_slots, total_slots, status, publish_time, end_time, del_flag, create_by, create_time, update_by, update_time, remark from sys_vac_info
  28. </sql>
  29. <select id="selectSysVacInfoList" parameterType="SysVacInfo" resultMap="SysVacInfoResult">
  30. <include refid="selectSysVacInfoVo"/>
  31. <where>
  32. <if test="title != null and title != ''"> and title = #{title}</if>
  33. <if test="vaccineType != null and vaccineType != ''"> and vaccine_type = #{vaccineType}</if>
  34. <if test="description != null and description != ''"> and description = #{description}</if>
  35. <if test="vaccinationDate != null "> and vaccination_date = #{vaccinationDate}</if>
  36. <if test="vaccinationLocation != null and vaccinationLocation != ''"> and vaccination_location = #{vaccinationLocation}</if>
  37. <if test="availableSlots != null "> and available_slots = #{availableSlots}</if>
  38. <if test="totalSlots != null "> and total_slots = #{totalSlots}</if>
  39. <if test="status != null "> and status = #{status}</if>
  40. <if test="publishTime != null "> and publish_time = #{publishTime}</if>
  41. <if test="endTime != null "> and end_time = #{endTime}</if>
  42. </where>
  43. </select>
  44. <select id="selectSysVacInfoById" parameterType="Long" resultMap="SysVacInfoResult">
  45. <include refid="selectSysVacInfoVo"/>
  46. where id = #{id}
  47. </select>
  48. <insert id="insertSysVacInfo" parameterType="SysVacInfo" useGeneratedKeys="true" keyProperty="id">
  49. insert into sys_vac_info
  50. <trim prefix="(" suffix=")" suffixOverrides=",">
  51. <if test="title != null and title != ''">title,</if>
  52. <if test="livestockType != null and livestockType != ''">livestock_type,</if>
  53. <if test="vaccineType != null and vaccineType != ''">vaccine_type,</if>
  54. <if test="description != null and description != ''">description,</if>
  55. <if test="vaccinationDate != null">vaccination_date,</if>
  56. <if test="vaccinationLocation != null and vaccinationLocation != ''">vaccination_location,</if>
  57. <if test="availableSlots != null">available_slots,</if>
  58. <if test="totalSlots != null">total_slots,</if>
  59. <if test="status != null">status,</if>
  60. <if test="publishTime != null">publish_time,</if>
  61. <if test="endTime != null">end_time,</if>
  62. <if test="delFlag != null">del_flag,</if>
  63. <if test="createBy != null">create_by,</if>
  64. <if test="createTime != null">create_time,</if>
  65. <if test="updateBy != null">update_by,</if>
  66. <if test="updateTime != null">update_time,</if>
  67. <if test="remark != null">remark,</if>
  68. </trim>
  69. <trim prefix="values (" suffix=")" suffixOverrides=",">
  70. <if test="title != null and title != ''">#{title},</if>
  71. <if test="livestockType != null and livestockType != ''">#{livestockType},</if>
  72. <if test="vaccineType != null and vaccineType != ''">#{vaccineType},</if>
  73. <if test="description != null and description != ''">#{description},</if>
  74. <if test="vaccinationDate != null">#{vaccinationDate},</if>
  75. <if test="vaccinationLocation != null and vaccinationLocation != ''">#{vaccinationLocation},</if>
  76. <if test="availableSlots != null">#{availableSlots},</if>
  77. <if test="totalSlots != null">#{totalSlots},</if>
  78. <if test="status != null">#{status},</if>
  79. <if test="publishTime != null">#{publishTime},</if>
  80. <if test="endTime != null">#{endTime},</if>
  81. <if test="delFlag != null">#{delFlag},</if>
  82. <if test="createBy != null">#{createBy},</if>
  83. <if test="createTime != null">#{createTime},</if>
  84. <if test="updateBy != null">#{updateBy},</if>
  85. <if test="updateTime != null">#{updateTime},</if>
  86. <if test="remark != null">#{remark},</if>
  87. </trim>
  88. </insert>
  89. <update id="updateSysVacInfo" parameterType="SysVacInfo">
  90. update sys_vac_info
  91. <trim prefix="SET" suffixOverrides=",">
  92. <if test="title != null and title != ''">title = #{title},</if>
  93. <if test="livestockType != null and livestockType != ''">livestock_type = #{livestockType},</if>
  94. <if test="vaccineType != null and vaccineType != ''">vaccine_type = #{vaccineType},</if>
  95. <if test="description != null and description != ''">description = #{description},</if>
  96. <if test="vaccinationDate != null">vaccination_date = #{vaccinationDate},</if>
  97. <if test="vaccinationLocation != null and vaccinationLocation != ''">vaccination_location = #{vaccinationLocation},</if>
  98. <if test="availableSlots != null">available_slots = #{availableSlots},</if>
  99. <if test="totalSlots != null">total_slots = #{totalSlots},</if>
  100. <if test="status != null">status = #{status},</if>
  101. <if test="publishTime != null">publish_time = #{publishTime},</if>
  102. <if test="endTime != null">end_time = #{endTime},</if>
  103. <if test="delFlag != null">del_flag = #{delFlag},</if>
  104. <if test="createBy != null">create_by = #{createBy},</if>
  105. <if test="createTime != null">create_time = #{createTime},</if>
  106. <if test="updateBy != null">update_by = #{updateBy},</if>
  107. <if test="updateTime != null">update_time = #{updateTime},</if>
  108. <if test="remark != null">remark = #{remark},</if>
  109. </trim>
  110. where id = #{id}
  111. </update>
  112. <delete id="deleteSysVacInfoById" parameterType="Long">
  113. delete from sys_vac_info where id = #{id}
  114. </delete>
  115. <delete id="deleteSysVacInfoByIds" parameterType="String">
  116. delete from sys_vac_info where id in
  117. <foreach item="id" collection="array" open="(" separator="," close=")">
  118. #{id}
  119. </foreach>
  120. </delete>
  121. </mapper>