anderx лет назад: 3
Родитель
Сommit
6d0eba56fc
1 измененных файлов с 8 добавлено и 2 удалено
  1. 8 2
      src/main/java/com/goafanti/common/mapper/AdminMapper.xml

+ 8 - 2
src/main/java/com/goafanti/common/mapper/AdminMapper.xml

@@ -44,7 +44,7 @@
     where id = #{id,jdbcType=VARCHAR}
   </delete>
   <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.Admin" useGeneratedKeys="true">
-    insert into admin (mobile, `name`, `password`,
+    insert into admin (id,mobile, `name`, `password`,
       email, create_time, `number`,
       province, `position`, superior_id,
       city, department_id, `status`,
@@ -53,7 +53,7 @@
       open_id, `type`, reviewer,
       amb_id, amb_role, amb_manage
       )
-    values (#{mobile,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{password,jdbcType=VARCHAR},
+    values (#{id,jdbcType=VARCHAR}, #{mobile,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{password,jdbcType=VARCHAR},
       #{email,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{number,jdbcType=INTEGER},
       #{province,jdbcType=VARCHAR}, #{position,jdbcType=VARCHAR}, #{superiorId,jdbcType=VARCHAR},
       #{city,jdbcType=VARCHAR}, #{departmentId,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR},
@@ -66,6 +66,9 @@
   <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.Admin" useGeneratedKeys="true">
     insert into admin
     <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        id,
+      </if>
       <if test="mobile != null">
         mobile,
       </if>
@@ -140,6 +143,9 @@
       </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        #{id,jdbcType=VARCHAR},
+      </if>
       <if test="mobile != null">
         #{mobile,jdbcType=VARCHAR},
       </if>