Newer
Older
stockTray / EastLineServer / src / main / resources / mybatis / NotifyMapper.xml
bello on 12 Aug 2020 1 KB 新增控制台
<?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="me.bello.eastline.dao.NotifyDao" >

    <!--查询通知规则列表-->
    <select id="doQueryNotifyList" resultType="HashMap">

        SELECT
            code, name, max, min, maxType, minType, percent, DATE_FORMAT(updateTime, '%Y-%m-%d %H:%i:%s') as time
        FROM
            t_notify
        ORDER BY
            updateTime DESC ;
    </select>

<!--    新增规则-->
    <insert id="AddNotify" >
        REPLACE INTO
            t_notify (
                code,
                name,
                max,
                min,
                maxType,
                minType,
                percent,
                updateTime,
                createTime
            ) VALUES(
                #{code},
                #{name},
                #{max},
                #{min},
                0,
                0,
                0,
                NOW(),
                NOW()
            );
    </insert>


<!--    删除规则-->
    <delete id="deleteNotify">

        DELETE FROM
            t_notify
        WHERE
            `code` = #{code};

    </delete>


</mapper>