|
@@ -0,0 +1,86 @@
|
|
|
+<?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.ruoyi.system.mapper.GroupingMapper">
|
|
|
+ <insert id="insertGrouping" parameterType="Grouping" useGeneratedKeys="true" keyProperty="id">
|
|
|
+ insert into grouping (
|
|
|
+ <if test="userName != null and userName != '' ">user_name,</if>
|
|
|
+ <if test="name != null and name != '' ">name,</if>
|
|
|
+ <if test="cellphone != null and cellphone != '' ">cellphone,</if>
|
|
|
+ <if test="isInform != null and isInform != '' or isInform == 0 ">is_inform,</if>
|
|
|
+ <if test="isForbidden != null and isForbidden != '' or isForbidden == 0 ">is_forbidden,</if>
|
|
|
+ creation_time
|
|
|
+ )values(
|
|
|
+ <if test="userName != null and userName != ''">#{userName},</if>
|
|
|
+ <if test="name != null and name != ''">#{name},</if>
|
|
|
+ <if test="cellphone != null and cellphone != ''">#{cellphone},</if>
|
|
|
+ <if test="isInform != null and isInform != ''">#{isInform},</if>
|
|
|
+ <if test="isForbidden != null and isForbidden != ''">#{isForbidden},</if>
|
|
|
+ sysdate()
|
|
|
+ )
|
|
|
+ </insert>
|
|
|
+ <insert id="insertRuleConfiguration">
|
|
|
+ insert into rule (
|
|
|
+ <if test="day != null and day != '' ">day,</if>
|
|
|
+ <if test="ratio != null and ratio != '' ">ratio,</if>
|
|
|
+ <if test="groupingId != null and groupingId != '' or groupingId == 0 ">grouping_id,</if>
|
|
|
+ <if test="name != null and name != '' ">name,</if>
|
|
|
+ creation_time
|
|
|
+ )values(
|
|
|
+ <if test="day != null and day != ''">#{day},</if>
|
|
|
+ <if test="ratio != null and ratio != ''">#{ratio},</if>
|
|
|
+ <if test="groupingId != null and groupingId != '' or groupingId == 0 ">#{groupingId},</if>
|
|
|
+ <if test="name != null and name != ''">#{name},</if>
|
|
|
+ sysdate()
|
|
|
+ )
|
|
|
+ </insert>
|
|
|
+ <update id="updateGrouping">
|
|
|
+ update grouping
|
|
|
+ <set>
|
|
|
+ <if test="userName != null and userName != ''">user_name = #{userName},</if>
|
|
|
+ <if test="name != null and name != ''">name = #{name},</if>
|
|
|
+ <if test="cellphone != null and cellphone != ''">cellphone = #{cellphone},</if>
|
|
|
+ <if test="isInform != null and isInform != '' or isInform == 0">is_inform = #{isInform},</if>
|
|
|
+ <if test="isForbidden != null and isForbidden != '' or isForbidden == 0">is_forbidden = #{isForbidden},</if>
|
|
|
+ </set>
|
|
|
+ where id = #{id}
|
|
|
+ </update>
|
|
|
+ <update id="updateRuleConfiguration">
|
|
|
+ update rule
|
|
|
+ <set>
|
|
|
+ <if test="day != null and day != ''">day = #{day},</if>
|
|
|
+ <if test="ratio != null and ratio != ''">ratio = #{ratio},</if>
|
|
|
+ <if test="groupingId != null and groupingId != ''">grouping_id = #{groupingId},</if>
|
|
|
+ <if test="name != null and name != ''">name = #{name},</if>
|
|
|
+ </set>
|
|
|
+ where id = #{id}
|
|
|
+ </update>
|
|
|
+
|
|
|
+
|
|
|
+ <select id="selectGroupingList" resultType="com.ruoyi.system.domain.Grouping">
|
|
|
+ select *,
|
|
|
+ user_name as userName,
|
|
|
+ is_inform as isInform,
|
|
|
+ creation_time as creationTime,
|
|
|
+ is_forbidden as isForbidden
|
|
|
+ from grouping
|
|
|
+ <where>
|
|
|
+ <if test="userName != null and userName != ''">
|
|
|
+ AND user_name like concat('%', #{userName}, '%')
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+ <select id="selectGroupingById" resultType="com.ruoyi.system.domain.Grouping">
|
|
|
+ select *,
|
|
|
+ user_name as userName,
|
|
|
+ is_inform as isInform,
|
|
|
+ creation_time as creationTime,
|
|
|
+ is_forbidden as isForbidden
|
|
|
+ from grouping
|
|
|
+ where id = #{id}
|
|
|
+ </select>
|
|
|
+ <select id="listRuleConfiguration" resultType="com.ruoyi.system.domain.Rule">
|
|
|
+ select r.*, r.grouping_id as groupingId, g.name as groupingName from rule r left join grouping g on r.grouping_id = g.id
|
|
|
+ </select>
|
|
|
+</mapper>
|