|
|
@@ -0,0 +1,219 @@
|
|
|
+<?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.ylx.massage.mapper.AlarmMapper">
|
|
|
+
|
|
|
+ <sql id="AlarmColumns">
|
|
|
+ id, order_no, merchant_id, merchant_name, merchant_nick_name, merchant_sex, merchant_avatar,
|
|
|
+ merchant_phone, address, alarm_status, note, create_by, create_time, update_by, update_time, is_delete
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <resultMap type="com.ylx.massage.domain.Alarm" id="YlxAlarmMap">
|
|
|
+ <result property="id" column="id" jdbcType="VARCHAR"/>
|
|
|
+ <result property="orderNo" column="order_no" jdbcType="VARCHAR"/>
|
|
|
+ <result property="merchantId" column="merchant_id" jdbcType="VARCHAR"/>
|
|
|
+ <result property="merchantName" column="merchant_name" jdbcType="VARCHAR"/>
|
|
|
+ <result property="merchantNickName" column="merchant_nick_name" jdbcType="VARCHAR"/>
|
|
|
+ <result property="merchantSex" column="merchant_sex" jdbcType="INTEGER"/>
|
|
|
+ <result property="merchantAvatar" column="merchant_avatar" jdbcType="VARCHAR"/>
|
|
|
+ <result property="merchantPhone" column="merchant_phone" jdbcType="VARCHAR"/>
|
|
|
+ <result property="address" column="address" jdbcType="VARCHAR"/>
|
|
|
+ <result property="alarmStatus" column="alarm_status" jdbcType="INTEGER"/>
|
|
|
+ <result property="note" column="note" jdbcType="VARCHAR"/>
|
|
|
+ <result property="createBy" column="create_by" jdbcType="VARCHAR"/>
|
|
|
+ <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
|
|
|
+ <result property="updateBy" column="update_by" jdbcType="VARCHAR"/>
|
|
|
+ <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
|
|
|
+ <result property="isDelete" column="is_delete" jdbcType="INTEGER"/>
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <!--查询单个-->
|
|
|
+ <select id="queryById" resultMap="YlxAlarmMap">
|
|
|
+ select <include refid="AlarmColumns"/>
|
|
|
+ from t_alarm
|
|
|
+ where id = #{id}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!--查询指定行数据-->
|
|
|
+ <select id="queryAllByLimit" resultMap="YlxAlarmMap">
|
|
|
+ select <include refid="AlarmColumns"/>
|
|
|
+ from t_alarm
|
|
|
+ <where>
|
|
|
+ <if test="id != null and id != ''">
|
|
|
+ and id = #{id}
|
|
|
+ </if>
|
|
|
+ <if test="orderNo != null and orderNo != ''">
|
|
|
+ and order_no = #{orderNo}
|
|
|
+ </if>
|
|
|
+ <if test="merchantId != null and merchantId != ''">
|
|
|
+ and merchant_id = #{merchantId}
|
|
|
+ </if>
|
|
|
+ <if test="merchantName != null and merchantName != ''">
|
|
|
+ and merchant_name = #{merchantName}
|
|
|
+ </if>
|
|
|
+ <if test="merchantNickName != null and merchantNickName != ''">
|
|
|
+ and merchant_nick_name = #{merchantNickName}
|
|
|
+ </if>
|
|
|
+ <if test="merchantSex != null">
|
|
|
+ and merchant_sex = #{merchantSex}
|
|
|
+ </if>
|
|
|
+ <if test="merchantPhone != null and merchantPhone != ''">
|
|
|
+ and merchant_phone = #{merchantPhone}
|
|
|
+ </if>
|
|
|
+ <if test="address != null and address != ''">
|
|
|
+ and address = #{address}
|
|
|
+ </if>
|
|
|
+ <if test="alarmStatus != null">
|
|
|
+ and alarm_status = #{alarmStatus}
|
|
|
+ </if>
|
|
|
+ <if test="isDelete != null">
|
|
|
+ and is_delete = #{isDelete}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ limit #{pageable.offset}, #{pageable.pageSize}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!--统计总行数-->
|
|
|
+ <select id="count" resultType="java.lang.Long">
|
|
|
+ select count(1)
|
|
|
+ from t_alarm
|
|
|
+ <where>
|
|
|
+ <if test="id != null and id != ''">
|
|
|
+ and id = #{id}
|
|
|
+ </if>
|
|
|
+ <if test="orderNo != null and orderNo != ''">
|
|
|
+ and order_no = #{orderNo}
|
|
|
+ </if>
|
|
|
+ <if test="merchantId != null and merchantId != ''">
|
|
|
+ and merchant_id = #{merchantId}
|
|
|
+ </if>
|
|
|
+ <if test="merchantName != null and merchantName != ''">
|
|
|
+ and merchant_name = #{merchantName}
|
|
|
+ </if>
|
|
|
+ <if test="merchantNickName != null and merchantNickName != ''">
|
|
|
+ and merchant_nick_name = #{merchantNickName}
|
|
|
+ </if>
|
|
|
+ <if test="merchantSex != null">
|
|
|
+ and merchant_sex = #{merchantSex}
|
|
|
+ </if>
|
|
|
+ <if test="merchantPhone != null and merchantPhone != ''">
|
|
|
+ and merchant_phone = #{merchantPhone}
|
|
|
+ </if>
|
|
|
+ <if test="address != null and address != ''">
|
|
|
+ and address = #{address}
|
|
|
+ </if>
|
|
|
+ <if test="alarmStatus != null">
|
|
|
+ and alarm_status = #{alarmStatus}
|
|
|
+ </if>
|
|
|
+ <if test="isDelete != null">
|
|
|
+ and is_delete = #{isDelete}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!--批量新增-->
|
|
|
+ <insert id="insertBatch">
|
|
|
+ insert into t_alarm
|
|
|
+ (<include refid="AlarmColumns"/>)
|
|
|
+ values
|
|
|
+ <foreach collection="entities" item="entity" separator=",">
|
|
|
+ (
|
|
|
+ #{entity.id}, #{entity.orderNo}, #{entity.merchantId}, #{entity.merchantName},
|
|
|
+ #{entity.merchantNickName}, #{entity.merchantSex}, #{entity.merchantAvatar},
|
|
|
+ #{entity.merchantPhone}, #{entity.address}, #{entity.alarmStatus}, #{entity.note},
|
|
|
+ #{entity.createBy}, #{entity.createTime}, #{entity.updateBy}, #{entity.updateTime}, #{entity.isDelete}
|
|
|
+ )
|
|
|
+ </foreach>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <!--批量新增或按主键更新-->
|
|
|
+ <insert id="insertOrUpdateBatch">
|
|
|
+ insert into t_alarm
|
|
|
+ (<include refid="AlarmColumns"/>)
|
|
|
+ values
|
|
|
+ <foreach collection="entities" item="entity" separator=",">
|
|
|
+ (
|
|
|
+ #{entity.id}, #{entity.orderNo}, #{entity.merchantId}, #{entity.merchantName},
|
|
|
+ #{entity.merchantNickName}, #{entity.merchantSex}, #{entity.merchantAvatar},
|
|
|
+ #{entity.merchantPhone}, #{entity.address}, #{entity.alarmStatus}, #{entity.note},
|
|
|
+ #{entity.createBy}, #{entity.createTime}, #{entity.updateBy}, #{entity.updateTime}, #{entity.isDelete}
|
|
|
+ )
|
|
|
+ </foreach>
|
|
|
+ on duplicate key update
|
|
|
+ order_no = values(order_no),
|
|
|
+ merchant_id = values(merchant_id),
|
|
|
+ merchant_name = values(merchant_name),
|
|
|
+ merchant_nick_name = values(merchant_nick_name),
|
|
|
+ merchant_sex = values(merchant_sex),
|
|
|
+ merchant_avatar = values(merchant_avatar),
|
|
|
+ merchant_phone = values(merchant_phone),
|
|
|
+ address = values(address),
|
|
|
+ alarm_status = values(alarm_status),
|
|
|
+ note = values(note),
|
|
|
+ create_by = values(create_by),
|
|
|
+ create_time = values(create_time),
|
|
|
+ update_by = values(update_by),
|
|
|
+ update_time = values(update_time),
|
|
|
+ is_delete = values(is_delete)
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <!--通过主键修改数据-->
|
|
|
+ <update id="update">
|
|
|
+ update t_alarm
|
|
|
+ <set>
|
|
|
+ <if test="orderNo != null and orderNo != ''">
|
|
|
+ order_no = #{orderNo},
|
|
|
+ </if>
|
|
|
+ <if test="merchantId != null and merchantId != ''">
|
|
|
+ merchant_id = #{merchantId},
|
|
|
+ </if>
|
|
|
+ <if test="merchantName != null and merchantName != ''">
|
|
|
+ merchant_name = #{merchantName},
|
|
|
+ </if>
|
|
|
+ <if test="merchantNickName != null and merchantNickName != ''">
|
|
|
+ merchant_nick_name = #{merchantNickName},
|
|
|
+ </if>
|
|
|
+ <if test="merchantSex != null">
|
|
|
+ merchant_sex = #{merchantSex},
|
|
|
+ </if>
|
|
|
+ <if test="merchantAvatar != null and merchantAvatar != ''">
|
|
|
+ merchant_avatar = #{merchantAvatar},
|
|
|
+ </if>
|
|
|
+ <if test="merchantPhone != null and merchantPhone != ''">
|
|
|
+ merchant_phone = #{merchantPhone},
|
|
|
+ </if>
|
|
|
+ <if test="address != null and address != ''">
|
|
|
+ address = #{address},
|
|
|
+ </if>
|
|
|
+ <if test="alarmStatus != null">
|
|
|
+ alarm_status = #{alarmStatus},
|
|
|
+ </if>
|
|
|
+ <if test="note != null and note != ''">
|
|
|
+ note = #{note},
|
|
|
+ </if>
|
|
|
+ <if test="createBy != null and createBy != ''">
|
|
|
+ create_by = #{createBy},
|
|
|
+ </if>
|
|
|
+ <if test="createTime != null">
|
|
|
+ create_time = #{createTime},
|
|
|
+ </if>
|
|
|
+ <if test="updateBy != null and updateBy != ''">
|
|
|
+ update_by = #{updateBy},
|
|
|
+ </if>
|
|
|
+ <if test="updateTime != null">
|
|
|
+ update_time = #{updateTime},
|
|
|
+ </if>
|
|
|
+ <if test="isDelete != null">
|
|
|
+ is_delete = #{isDelete},
|
|
|
+ </if>
|
|
|
+ </set>
|
|
|
+ where id = #{id}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <!--通过主键删除-->
|
|
|
+ <delete id="deleteById">
|
|
|
+ delete
|
|
|
+ from t_alarm
|
|
|
+ where id = #{id}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+</mapper>
|