@@ -6,6 +6,13 @@
values (#{id},#{name},#{parentId},#{order})
</insert>
+ <update id="update">
+ update wx_depart
+ set name=#{name},parentId=#{parentId},orderBy=#{orderBy}
+ where id=#{id}
+
+ </update>
<select id="selectById" resultType="WxDepart">
select * from wx_depart where id=#{id}
</select>
@@ -23,6 +23,8 @@ public class WxDepartService extends BaseService {
for (WxCpDepart depart : departs) {
if(selectById(depart.getId()) == null) {
save("WxDepartMapper.save", depart);
+ } else {
+ update("WxDepartMapper.update", depart);
}