|
|
<?xml version="1.0" encoding="UTF-8" ?><!DOCTYPE mapperPUBLIC "-//mybatis.org//DTD Mapper 3.0//EN""http://mybatis.org/dtd/mybatis-3-mapper.dtd"><mapper namespace="com.chenhai.system.mapper.SysVacInfoMapper"> <resultMap type="SysVacInfo" id="SysVacInfoResult"> <result property="id" column="id" /> <result property="title" column="title" /> <result property="livestockType" column="livestock_type" /> <result property="vaccineType" column="vaccine_type" /> <result property="description" column="description" /> <result property="vaccinationDate" column="vaccination_date" /> <result property="vaccinationLocation" column="vaccination_location" /> <result property="availableSlots" column="available_slots" /> <result property="totalSlots" column="total_slots" /> <result property="status" column="status" /> <result property="publishTime" column="publish_time" /> <result property="endTime" column="end_time" /> <result property="delFlag" column="del_flag" /> <result property="createBy" column="create_by" /> <result property="createTime" column="create_time" /> <result property="updateBy" column="update_by" /> <result property="updateTime" column="update_time" /> <result property="remark" column="remark" /> </resultMap>
<sql id="selectSysVacInfoVo"> 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 </sql>
<select id="selectSysVacInfoList" parameterType="SysVacInfo" resultMap="SysVacInfoResult"> <include refid="selectSysVacInfoVo"/> <where> <if test="title != null and title != ''"> and title = #{title}</if> <if test="vaccineType != null and vaccineType != ''"> and vaccine_type = #{vaccineType}</if> <if test="description != null and description != ''"> and description = #{description}</if> <if test="vaccinationDate != null "> and vaccination_date = #{vaccinationDate}</if> <if test="vaccinationLocation != null and vaccinationLocation != ''"> and vaccination_location = #{vaccinationLocation}</if> <if test="availableSlots != null "> and available_slots = #{availableSlots}</if> <if test="totalSlots != null "> and total_slots = #{totalSlots}</if> <if test="status != null "> and status = #{status}</if> <if test="publishTime != null "> and publish_time = #{publishTime}</if> <if test="endTime != null "> and end_time = #{endTime}</if> </where> </select> <select id="selectSysVacInfoById" parameterType="Long" resultMap="SysVacInfoResult"> <include refid="selectSysVacInfoVo"/> where id = #{id} </select>
<insert id="insertSysVacInfo" parameterType="SysVacInfo" useGeneratedKeys="true" keyProperty="id"> insert into sys_vac_info <trim prefix="(" suffix=")" suffixOverrides=","> <if test="title != null and title != ''">title,</if> <if test="livestockType != null and livestockType != ''">livestock_type,</if> <if test="vaccineType != null and vaccineType != ''">vaccine_type,</if> <if test="description != null and description != ''">description,</if> <if test="vaccinationDate != null">vaccination_date,</if> <if test="vaccinationLocation != null and vaccinationLocation != ''">vaccination_location,</if> <if test="availableSlots != null">available_slots,</if> <if test="totalSlots != null">total_slots,</if> <if test="status != null">status,</if> <if test="publishTime != null">publish_time,</if> <if test="endTime != null">end_time,</if> <if test="delFlag != null">del_flag,</if> <if test="createBy != null">create_by,</if> <if test="createTime != null">create_time,</if> <if test="updateBy != null">update_by,</if> <if test="updateTime != null">update_time,</if> <if test="remark != null">remark,</if> </trim> <trim prefix="values (" suffix=")" suffixOverrides=","> <if test="title != null and title != ''">#{title},</if> <if test="livestockType != null and livestockType != ''">#{livestockType},</if> <if test="vaccineType != null and vaccineType != ''">#{vaccineType},</if> <if test="description != null and description != ''">#{description},</if> <if test="vaccinationDate != null">#{vaccinationDate},</if> <if test="vaccinationLocation != null and vaccinationLocation != ''">#{vaccinationLocation},</if> <if test="availableSlots != null">#{availableSlots},</if> <if test="totalSlots != null">#{totalSlots},</if> <if test="status != null">#{status},</if> <if test="publishTime != null">#{publishTime},</if> <if test="endTime != null">#{endTime},</if> <if test="delFlag != null">#{delFlag},</if> <if test="createBy != null">#{createBy},</if> <if test="createTime != null">#{createTime},</if> <if test="updateBy != null">#{updateBy},</if> <if test="updateTime != null">#{updateTime},</if> <if test="remark != null">#{remark},</if> </trim> </insert>
<update id="updateSysVacInfo" parameterType="SysVacInfo"> update sys_vac_info <trim prefix="SET" suffixOverrides=","> <if test="title != null and title != ''">title = #{title},</if> <if test="livestockType != null and livestockType != ''">livestock_type = #{livestockType},</if> <if test="vaccineType != null and vaccineType != ''">vaccine_type = #{vaccineType},</if> <if test="description != null and description != ''">description = #{description},</if> <if test="vaccinationDate != null">vaccination_date = #{vaccinationDate},</if> <if test="vaccinationLocation != null and vaccinationLocation != ''">vaccination_location = #{vaccinationLocation},</if> <if test="availableSlots != null">available_slots = #{availableSlots},</if> <if test="totalSlots != null">total_slots = #{totalSlots},</if> <if test="status != null">status = #{status},</if> <if test="publishTime != null">publish_time = #{publishTime},</if> <if test="endTime != null">end_time = #{endTime},</if> <if test="delFlag != null">del_flag = #{delFlag},</if> <if test="createBy != null">create_by = #{createBy},</if> <if test="createTime != null">create_time = #{createTime},</if> <if test="updateBy != null">update_by = #{updateBy},</if> <if test="updateTime != null">update_time = #{updateTime},</if> <if test="remark != null">remark = #{remark},</if> </trim> where id = #{id} </update>
<delete id="deleteSysVacInfoById" parameterType="Long"> delete from sys_vac_info where id = #{id} </delete>
<delete id="deleteSysVacInfoByIds" parameterType="String"> delete from sys_vac_info where id in <foreach item="id" collection="array" open="(" separator="," close=")"> #{id} </foreach> </delete></mapper>
|