配件管理新增失败bug修改

This commit is contained in:
wcy 2024-09-23 14:29:08 +08:00
parent e614875c3a
commit 322ae3d804
1 changed files with 9 additions and 9 deletions

View File

@ -30,30 +30,30 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<insert id="insertMaPartType" parameterType="com.bonus.sgzb.base.mapper.MaPartTypeMapper" useGeneratedKeys="true" keyProperty="paId">
insert into ma_part_type(
insert into ma_part_type (
<if test="paId != null and paId != 0">pa_id,</if>
<if test="paName != null and paName != ''">pa_name,</if>
<if test="parentId != null and parentId != 0">parent_id,</if>
parent_id, <!-- 始终插入 parentId -->
<if test="status != null and status != ''">status,</if>
<if test="num != null and num != 0">num,</if>
<if test="unitId != null and unitId != ''">unit_id,</if>
<if test="buyPrice != null and buyPrice != 0">buy_price,</if>
<if test="level != null and level != 0">level,</if>
level, <!-- 始终插入 level -->
<if test="warnNum != null and warnNum != 0">warn_num,</if>
<if test="remark != null and remark != ''">remark,</if>
<if test="createBy != null and createBy != ''">create_by,</if>
<if test="companyId != null and companyId != ''">company_id,</if>
create_time
)values(
) values (
<if test="paId != null and paId != 0">#{paId},</if>
<if test="paName != null and paName != ''">#{paName},</if>
<if test="parentId != null and parentId != 0">#{parentId},</if>
COALESCE(#{parentId}, 0), <!-- 如果 parentId 为空,则设置为 0 -->
<if test="status != null and status != ''">#{status},</if>
<if test="num != null and num != ''">#{num},</if>
<if test="num != null and num != 0">#{num},</if>
<if test="unitId != null and unitId != ''">#{unitId},</if>
<if test="buyPrice != null and buyPrice != ''">#{buyPrice},</if>
<if test="level != null and level != ''">#{level},</if>
<if test="warnNum != null and warnNum != ''">#{warnNum},</if>
<if test="buyPrice != null and buyPrice != 0">#{buyPrice},</if>
COALESCE(#{level}, 1), <!-- 如果 level 为空,则设置为 1 -->
<if test="warnNum != null and warnNum != 0">#{warnNum},</if>
<if test="remark != null and remark != ''">#{remark},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if>
<if test="companyId != null and companyId != ''">#{companyId},</if>