Files
BMS/bms-back/ruoyi-system/src/main/resources/mapper/price/PrcWeightSectionTemplateMapper.xml
T
2026-09-04 14:56:05 +08:00

114 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.price.mapper.PrcWeightSectionTemplateMapper">
<resultMap type="PrcWeightSectionTemplate" id="PrcWeightSectionTemplateResult">
<id property="wstId" column="wst_id" />
<result property="wstName" column="wst_name" />
<result property="ssCode" column="ss_code" />
<result property="pgCode" column="pg_code" />
<result property="snId" column="sn_id" />
<result property="ctCode" column="ct_code" />
<result property="pmCode" column="pm_code" />
<result property="wstNote" column="wst_note" />
<result property="tmsId" column="tms_id" />
<result property="createBy" column="created_by" />
<result property="createTime" column="created_at" />
<result property="updateBy" column="updated_by" />
<result property="updateTime" column="updated_at" />
<result property="detailCount" column="detail_count" />
</resultMap>
<sql id="selectPrcWeightSectionTemplateVo">
select wst_id, wst_name, ss_code, pg_code, sn_id, ct_code, pm_code, wst_note, tms_id,
created_by, created_at, updated_by, updated_at
from prc_weight_section_template
</sql>
<select id="selectPrcWeightSectionTemplateById" parameterType="Long" resultMap="PrcWeightSectionTemplateResult">
<include refid="selectPrcWeightSectionTemplateVo"/>
where wst_id = #{wstId}
</select>
<select id="selectPrcWeightSectionTemplateList" parameterType="PrcWeightSectionTemplate" resultMap="PrcWeightSectionTemplateResult">
<include refid="selectPrcWeightSectionTemplateVo"/>
<where>
<if test="wstName != null and wstName != ''">
AND wst_name like concat('%', #{wstName}, '%')
</if>
<if test="ssCode != null and ssCode != ''">
AND ss_code = #{ssCode}
</if>
<if test="pgCode != null and pgCode != ''">
AND pg_code = #{pgCode}
</if>
<if test="snId != null">
AND sn_id = #{snId}
</if>
<if test="ctCode != null and ctCode != ''">
AND ct_code = #{ctCode}
</if>
<if test="pmCode != null and pmCode != ''">
AND pm_code = #{pmCode}
</if>
<if test="tmsId != null">
AND tms_id = #{tmsId}
</if>
</where>
order by wst_id desc
</select>
<insert id="insertPrcWeightSectionTemplate" parameterType="PrcWeightSectionTemplate" useGeneratedKeys="true" keyProperty="wstId">
insert into prc_weight_section_template (
<if test="wstName != null and wstName != ''">wst_name,</if>
<if test="ssCode != null and ssCode != ''">ss_code,</if>
<if test="pgCode != null">pg_code,</if>
<if test="snId != null">sn_id,</if>
<if test="ctCode != null">ct_code,</if>
<if test="pmCode != null">pm_code,</if>
<if test="wstNote != null">wst_note,</if>
<if test="tmsId != null">tms_id,</if>
<if test="createBy != null and createBy != ''">created_by,</if>
created_at
) values (
<if test="wstName != null and wstName != ''">#{wstName},</if>
<if test="ssCode != null and ssCode != ''">#{ssCode},</if>
<if test="pgCode != null">#{pgCode},</if>
<if test="snId != null">#{snId},</if>
<if test="ctCode != null">#{ctCode},</if>
<if test="pmCode != null">#{pmCode},</if>
<if test="wstNote != null">#{wstNote},</if>
<if test="tmsId != null">#{tmsId},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if>
sysdate()
)
</insert>
<update id="updatePrcWeightSectionTemplate" parameterType="PrcWeightSectionTemplate">
update prc_weight_section_template
<set>
<if test="wstName != null and wstName != ''">wst_name = #{wstName},</if>
<if test="ssCode != null and ssCode != ''">ss_code = #{ssCode},</if>
<if test="pgCode != null">pg_code = #{pgCode},</if>
<if test="snId != null">sn_id = #{snId},</if>
<if test="ctCode != null">ct_code = #{ctCode},</if>
<if test="pmCode != null">pm_code = #{pmCode},</if>
<if test="wstNote != null">wst_note = #{wstNote},</if>
<if test="tmsId != null">tms_id = #{tmsId},</if>
<if test="updateBy != null and updateBy != ''">updated_by = #{updateBy},</if>
updated_at = sysdate()
</set>
where wst_id = #{wstId}
</update>
<delete id="deletePrcWeightSectionTemplateByIds" parameterType="Long">
delete from prc_weight_section_template where wst_id in
<foreach item="wstId" collection="array" open="(" separator="," close=")">
#{wstId}
</foreach>
</delete>
</mapper>