RuoYi/ruoyi-system/src/main/resources/mapper/system/SysBillNoMapper.xml

77 lines
3.3 KiB
XML

<?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.SysBillNoMapper">
<resultMap type="SysBillNo" id="SysBillNoResult">
<result property="fperiod" column="fperiod" />
<result property="billName" column="bill_name" />
<result property="iterationValue" column="iteration_value" />
<result property="nextValue" column="next_value" />
<result property="remark" column="remark" />
</resultMap>
<sql id="selectSysBillNoVo">
select fperiod, bill_name, iteration_value, next_value, remark from sys_bill_no
</sql>
<select id="selectSysBillNoList" parameterType="SysBillNo" resultMap="SysBillNoResult">
<include refid="selectSysBillNoVo"/>
<where>
<if test="iterationValue != null and iterationValue != ''"> and iteration_value = #{iterationValue}</if>
<if test="nextValue != null and nextValue != ''"> and next_value = #{nextValue}</if>
</where>
</select>
<select id="selectSysBillNoByBillPrefix" parameterType="String" resultMap="SysBillNoResult">
<include refid="selectSysBillNoVo"/>
where bill_prefix = #{billPrefix}
</select>
<select id="selectSysBillNoById" parameterType="String" resultMap="SysBillNoResult">
<include refid="selectSysBillNoVo"/>
where fperiod = #{fperiod}
</select>
<insert id="insertSysBillNo" parameterType="SysBillNo">
insert into sys_bill_no
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="fperiod != null">fperiod,</if>
<if test="billName != null">bill_name,</if>
<if test="iterationValue != null and iterationValue != ''">iteration_value,</if>
<if test="nextValue != null and nextValue != ''">next_value,</if>
<if test="remark != null">remark,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="fperiod != null">#{fperiod},</if>
<if test="billName != null">#{billName},</if>
<if test="iterationValue != null and iterationValue != ''">#{iterationValue},</if>
<if test="nextValue != null and nextValue != ''">#{nextValue},</if>
<if test="remark != null">#{remark},</if>
</trim>
</insert>
<update id="updateSysBillNo" parameterType="SysBillNo">
update sys_bill_no
<trim prefix="SET" suffixOverrides=",">
<if test="billName != null">bill_name = #{billName},</if>
<if test="iterationValue != null and iterationValue != ''">iteration_value = #{iterationValue},</if>
<if test="nextValue != null and nextValue != ''">next_value = #{nextValue},</if>
<if test="remark != null">remark = #{remark},</if>
</trim>
where fperiod = #{fperiod}
</update>
<delete id="deleteSysBillNoById" parameterType="String">
delete from sys_bill_no where fperiod = #{fperiod}
</delete>
<delete id="deleteSysBillNoByIds" parameterType="String">
delete from sys_bill_no where fperiod in
<foreach item="fperiod" collection="array" open="(" separator="," close=")">
#{fperiod}
</foreach>
</delete>
</mapper>