迭代 注册方法1.4

master
冯凯 2023-10-20 21:40:30 +08:00
parent c57b614ff8
commit 4742f6e8f3
1 changed files with 33 additions and 30 deletions

View File

@ -185,36 +185,39 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<choose>
<when test="roleId==1">
insert into tb_patient(
<if test="patientId!=null">patient_id,</if>
<if test="name!=null and name!=''">patient_name,</if>
<if test="password!=null and password!=''">password,</if>
<if test="email!=null and email!=''">email,</if>
<if test="inviteCode!=null and inviteCode!=''">invite_code,</if>
<if test="avatar!=null and avatar!=''">avatar,</if>
<if test="gender!=null">gender,</if>
<if test="height!=null">height,</if>
<if test="weight!=null">weight,</if>
<if test="age!=null">age,</if>
<if test="wechatNumber!=null and wechatNumber!=''">wechat_number,</if>
)
values(
<if test="patientId!=null">#{patientId},</if>
<if test="name!=null and name!=''">#{name},</if>
<if test="password!=null and password!=''">#{password},</if>
<if test="email!=null and email!=''">#{email},</if>
<if test="inviteCode!=null and inviteCode!=''">#{inviteCode},</if>
<if test="avatar!=null and avatar!=''">#{avatar},</if>
<if test="gender!=null">#{gender},</if>
<if test="height!=null">#{height},</if>
<if test="weight!=null">#{weight},</if>
<if test="age!=null">#{age},</if>
<if test="wechatNumber!=null and wechatNumber!=''">#{wechatNumber},</if>
)
insert into tb_patient
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="patientId!=null">patient_id,</if>
<if test="name!=null and name!=''">patient_name,</if>
<if test="password!=null and password!=''">password,</if>
<if test="email!=null and email!=''">email,</if>
<if test="inviteCode!=null and inviteCode!=''">invite_code,</if>
<if test="avatar!=null and avatar!=''">avatar,</if>
<if test="gender!=null">gender,</if>
<if test="height!=null">height,</if>
<if test="weight!=null">weight,</if>
<if test="age!=null">age,</if>
<if test="wechatNumber!=null and wechatNumber!=''">wechat_number</if>
</trim>
values
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="patientId!=null">#{patientId},</if>
<if test="name!=null and name!=''">#{name},</if>
<if test="password!=null and password!=''">#{password},</if>
<if test="email!=null and email!=''">#{email},</if>
<if test="inviteCode!=null and inviteCode!=''">#{inviteCode},</if>
<if test="avatar!=null and avatar!=''">#{avatar},</if>
<if test="gender!=null">#{gender},</if>
<if test="height!=null">#{height},</if>
<if test="weight!=null">#{weight},</if>
<if test="age!=null">#{age},</if>
<if test="wechatNumber!=null and wechatNumber!=''">#{wechatNumber}</if>
</trim>
</when>
<otherwise>
insert into tb_doctor
(
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="doctorId!=null"> doctor_id,</if>
<if test="name!=null and name!=''">doctor_name,</if>
<if test="password!=null and password!=''">password,</if>
@ -225,9 +228,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="introduce!=null and introduce!=''">introduce,</if>
<if test="skilled!=null and skilled!=''">skilled,</if>
<if test="avatar!=null and avatar!=''">avatar,</if>
)
</trim>
values
(
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="doctorId!=null"> #{doctorId},</if>
<if test="name!=null and name!=''">#{name},</if>
<if test="password!=null and password!=''">#{password},</if>
@ -238,7 +241,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="introduce!=null and introduce!=''">#{introduce},</if>
<if test="skilled!=null and skilled!=''">#{skilled},</if>
<if test="avatar!=null and avatar!=''">#{avatar},</if>
)
</trim>
</otherwise>
</choose>
</insert>