|
@@ -0,0 +1,121 @@
|
|
|
+<?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.base.mapper.BaseIdsequenceMapper">
|
|
|
+
|
|
|
+ <resultMap type="BaseIdsequence" id="BaseIdsequenceResult">
|
|
|
+ <result property="idName" column="id_name" />
|
|
|
+ <result property="descr" column="descr" />
|
|
|
+ <result property="idType" column="id_type" />
|
|
|
+ <result property="idSequence" column="id_sequence" />
|
|
|
+ <result property="createDate" column="create_date" />
|
|
|
+ <result property="maxIdSequence" column="max_id_sequence" />
|
|
|
+ <result property="createUserId" column="create_user_id" />
|
|
|
+ <result property="editTime" column="edit_time" />
|
|
|
+ <result property="editUserId" column="edit_user_id" />
|
|
|
+ <result property="prefix" column="prefix" />
|
|
|
+ <result property="length" column="length" />
|
|
|
+ <result property="dateFormat" column="date_format" />
|
|
|
+ <result property="dateMax" column="date_max" />
|
|
|
+ <result property="warehouseid" column="warehouseid" />
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <sql id="selectBaseIdsequenceVo">
|
|
|
+ select id_name, descr, id_type, id_sequence, create_date, max_id_sequence, create_user_id, edit_time, edit_user_id, prefix, length, date_format, date_max, warehouseid from base_idsequence
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="selectBaseIdsequenceList" parameterType="BaseIdsequence" resultMap="BaseIdsequenceResult">
|
|
|
+ <include refid="selectBaseIdsequenceVo"/>
|
|
|
+ <where>
|
|
|
+ <if test="descr != null and descr != ''"> and descr = #{descr}</if>
|
|
|
+ <if test="idType != null and idType != ''"> and id_type = #{idType}</if>
|
|
|
+ <if test="idSequence != null "> and id_sequence = #{idSequence}</if>
|
|
|
+ <if test="createDate != null "> and create_date = #{createDate}</if>
|
|
|
+ <if test="maxIdSequence != null "> and max_id_sequence = #{maxIdSequence}</if>
|
|
|
+ <if test="createUserId != null and createUserId != ''"> and create_user_id = #{createUserId}</if>
|
|
|
+ <if test="editTime != null "> and edit_time = #{editTime}</if>
|
|
|
+ <if test="editUserId != null and editUserId != ''"> and edit_user_id = #{editUserId}</if>
|
|
|
+ <if test="prefix != null and prefix != ''"> and prefix = #{prefix}</if>
|
|
|
+ <if test="length != null "> and length = #{length}</if>
|
|
|
+ <if test="dateFormat != null and dateFormat != ''"> and date_format = #{dateFormat}</if>
|
|
|
+ <if test="dateMax != null and dateMax != ''"> and date_max = #{dateMax}</if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectBaseIdsequenceByIdName" parameterType="String" resultMap="BaseIdsequenceResult">
|
|
|
+ <include refid="selectBaseIdsequenceVo"/>
|
|
|
+ where id_name = #{idName}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <insert id="insertBaseIdsequence" parameterType="BaseIdsequence">
|
|
|
+ insert into base_idsequence
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="idName != null">id_name,</if>
|
|
|
+ <if test="descr != null">descr,</if>
|
|
|
+ <if test="idType != null and idType != ''">id_type,</if>
|
|
|
+ <if test="idSequence != null">id_sequence,</if>
|
|
|
+ <if test="createDate != null">create_date,</if>
|
|
|
+ <if test="maxIdSequence != null">max_id_sequence,</if>
|
|
|
+ <if test="createUserId != null">create_user_id,</if>
|
|
|
+ <if test="editTime != null">edit_time,</if>
|
|
|
+ <if test="editUserId != null">edit_user_id,</if>
|
|
|
+ <if test="prefix != null">prefix,</if>
|
|
|
+ <if test="length != null">length,</if>
|
|
|
+ <if test="dateFormat != null">date_format,</if>
|
|
|
+ <if test="dateMax != null">date_max,</if>
|
|
|
+ <if test="warehouseid != null">warehouseid,</if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="idName != null">#{idName},</if>
|
|
|
+ <if test="descr != null">#{descr},</if>
|
|
|
+ <if test="idType != null and idType != ''">#{idType},</if>
|
|
|
+ <if test="idSequence != null">#{idSequence},</if>
|
|
|
+ <if test="createDate != null">#{createDate},</if>
|
|
|
+ <if test="maxIdSequence != null">#{maxIdSequence},</if>
|
|
|
+ <if test="createUserId != null">#{createUserId},</if>
|
|
|
+ <if test="editTime != null">#{editTime},</if>
|
|
|
+ <if test="editUserId != null">#{editUserId},</if>
|
|
|
+ <if test="prefix != null">#{prefix},</if>
|
|
|
+ <if test="length != null">#{length},</if>
|
|
|
+ <if test="dateFormat != null">#{dateFormat},</if>
|
|
|
+ <if test="dateMax != null">#{dateMax},</if>
|
|
|
+ <if test="warehouseid != null">#{warehouseid},</if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <update id="updateBaseIdsequence" parameterType="BaseIdsequence">
|
|
|
+ update base_idsequence
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
+ <if test="descr != null">descr = #{descr},</if>
|
|
|
+ <if test="idType != null and idType != ''">id_type = #{idType},</if>
|
|
|
+ <if test="idSequence != null">id_sequence = #{idSequence},</if>
|
|
|
+ <if test="createDate != null">create_date = #{createDate},</if>
|
|
|
+ <if test="maxIdSequence != null">max_id_sequence = #{maxIdSequence},</if>
|
|
|
+ <if test="createUserId != null">create_user_id = #{createUserId},</if>
|
|
|
+ <if test="editTime != null">edit_time = #{editTime},</if>
|
|
|
+ <if test="editUserId != null">edit_user_id = #{editUserId},</if>
|
|
|
+ <if test="prefix != null">prefix = #{prefix},</if>
|
|
|
+ <if test="length != null">length = #{length},</if>
|
|
|
+ <if test="dateFormat != null">date_format = #{dateFormat},</if>
|
|
|
+ <if test="dateMax != null">date_max = #{dateMax},</if>
|
|
|
+ <if test="warehouseid != null">warehouseid = #{warehouseid},</if>
|
|
|
+ </trim>
|
|
|
+ where id_name = #{idName}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <delete id="deleteBaseIdsequenceByIdName" parameterType="String">
|
|
|
+ delete from base_idsequence where id_name = #{idName}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <delete id="deleteBaseIdsequenceByIdNames" parameterType="String">
|
|
|
+ delete from base_idsequence where id_name in
|
|
|
+ <foreach item="idName" collection="array" open="(" separator="," close=")">
|
|
|
+ #{idName}
|
|
|
+ </foreach>
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <update id="updateByVersion">
|
|
|
+ update sys_idsequence set id_sequence = #{nextId},date_max=#{dateStr} where id_name=#{idName} and id_sequence=#{idSequence}
|
|
|
+ </update>
|
|
|
+</mapper>
|