111 lines
5.1 KiB
XML
111 lines
5.1 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.SysUnitConvertMapper">
|
|
|
|
<resultMap type="SysUnitConvert" id="SysUnitConvertResult">
|
|
<result property="id" column="id"/>
|
|
<result property="unitType" column="unit_type"/>
|
|
<result property="unitName" column="unit_name"/>
|
|
<result property="baseUnit" column="base_unit"/>
|
|
<result property="conversionFactor" column="conversion_factor"/>
|
|
<result property="unitTypeName" column="unit_type_name"/>
|
|
<result property="status" column="status"/>
|
|
<result property="unitOrder" column="unit_order"/>
|
|
</resultMap>
|
|
|
|
<sql id="selectSysUnitConvertVo">
|
|
select id,
|
|
unit_type,
|
|
unit_name,
|
|
base_unit,
|
|
conversion_factor,
|
|
unit_type_name,
|
|
status,
|
|
unit_order
|
|
from sys_unit_convert
|
|
</sql>
|
|
|
|
<select id="selectSysUnitConvertList" parameterType="SysUnitConvert" resultMap="SysUnitConvertResult">
|
|
<include refid="selectSysUnitConvertVo"/>
|
|
<where>
|
|
<if test="unitType != null and unitType != ''">and unit_type = #{unitType}</if>
|
|
<if test="unitName != null and unitName != ''">and unit_name like concat('%', #{unitName}, '%')</if>
|
|
<if test="baseUnit != null and baseUnit != ''">and base_unit = #{baseUnit}</if>
|
|
<if test="conversionFactor != null ">and conversion_factor = #{conversionFactor}</if>
|
|
<if test="unitTypeName != null and unitTypeName != ''">and unit_type_name like concat('%', #{unitTypeName},
|
|
'%')
|
|
</if>
|
|
<if test="status != null and status != ''">and status = #{status}</if>
|
|
<if test="unitOrder != null ">and unit_order = #{unitOrder}</if>
|
|
</where>
|
|
</select>
|
|
|
|
<select id="selectSysUnitConvertUnitByTypeOrder" parameterType="SysUnitConvert"
|
|
resultMap="SysUnitConvertResult">
|
|
<!-- 这里编写具体的 SQL 查询语句 -->
|
|
<include refid="selectSysUnitConvertVo"/>
|
|
<where>
|
|
<if test="unitType != null and unitType != ''">and unit_type = #{unitType}</if>
|
|
<if test="unitOrder != null ">and unit_order = #{unitOrder}</if>
|
|
<if test="baseUnit != null and baseUnit != ''">and base_unit = #{baseUnit}</if>
|
|
|
|
</where>
|
|
</select>
|
|
|
|
|
|
<select id="selectSysUnitConvertById" parameterType="Long" resultMap="SysUnitConvertResult">
|
|
<include refid="selectSysUnitConvertVo"/>
|
|
where id = #{id}
|
|
</select>
|
|
|
|
<insert id="insertSysUnitConvert" parameterType="SysUnitConvert" useGeneratedKeys="true" keyProperty="id">
|
|
insert into sys_unit_convert
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="unitType != null and unitType != ''">unit_type,</if>
|
|
<if test="unitName != null and unitName != ''">unit_name,</if>
|
|
<if test="baseUnit != null">base_unit,</if>
|
|
<if test="conversionFactor != null">conversion_factor,</if>
|
|
<if test="unitTypeName != null and unitTypeName != ''">unit_type_name,</if>
|
|
<if test="status != null">status,</if>
|
|
<if test="unitOrder != null">unit_order,</if>
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<if test="unitType != null and unitType != ''">#{unitType},</if>
|
|
<if test="unitName != null and unitName != ''">#{unitName},</if>
|
|
<if test="baseUnit != null">#{baseUnit},</if>
|
|
<if test="conversionFactor != null">#{conversionFactor},</if>
|
|
<if test="unitTypeName != null and unitTypeName != ''">#{unitTypeName},</if>
|
|
<if test="status != null">#{status},</if>
|
|
<if test="unitOrder != null">#{unitOrder},</if>
|
|
</trim>
|
|
</insert>
|
|
|
|
<update id="updateSysUnitConvert" parameterType="SysUnitConvert">
|
|
update sys_unit_convert
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
<if test="unitType != null and unitType != ''">unit_type = #{unitType},</if>
|
|
<if test="unitName != null and unitName != ''">unit_name = #{unitName},</if>
|
|
<if test="baseUnit != null">base_unit = #{baseUnit},</if>
|
|
<if test="conversionFactor != null">conversion_factor = #{conversionFactor},</if>
|
|
<if test="unitTypeName != null and unitTypeName != ''">unit_type_name = #{unitTypeName},</if>
|
|
<if test="status != null">status = #{status},</if>
|
|
<if test="unitOrder != null">unit_order = #{unitOrder},</if>
|
|
</trim>
|
|
where id = #{id}
|
|
</update>
|
|
|
|
<delete id="deleteSysUnitConvertById" parameterType="Long">
|
|
delete
|
|
from sys_unit_convert
|
|
where id = #{id}
|
|
</delete>
|
|
|
|
<delete id="deleteSysUnitConvertByIds" parameterType="String">
|
|
delete from sys_unit_convert where id in
|
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
|
#{id}
|
|
</foreach>
|
|
</delete>
|
|
</mapper> |