<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.casic.missiles.mapper.meter.MeterCertificateExpireMessageMapper">

    <insert id="addMessageList" parameterType="java.util.List">
        INSERT INTO meter_certificate_expire_message ( `id`, `staff_id`, `certificate_id`, `staff_no`, `certificate_no`, `certificate_name`, `valid_date`, `status` )
        VALUES
        <foreach collection ="messageList" item="bean" separator =",">
            (#{bean.id},#{bean.staffId},#{bean.certificateId},#{bean.staffNo},#{bean.certificateNo},#{bean.certificateName},STR_TO_DATE(#{bean.validDate},'%Y-%m-%d'),,0)
        </foreach >
    </insert>

    <update id="readMessage" parameterType="long">
        UPDATE meter_certificate_expire_message SET `status` = 1 WHERE `id` = #{id}
    </update>
</mapper>
