添加idcard
parent
c2ff23d1fc
commit
be25972178
|
@ -76,7 +76,7 @@ public class SysIdCardController {
|
||||||
idCard.setIssueOffice(issueOffice);
|
idCard.setIssueOffice(issueOffice);
|
||||||
idCard.setAddress(address);
|
idCard.setAddress(address);
|
||||||
idCard.setUserId(SecurityUtils.getUserId());
|
idCard.setUserId(SecurityUtils.getUserId());
|
||||||
|
Boolean flag= sysIdCardService.insertIdCard(idCard);
|
||||||
return Result.success();
|
return flag==true?Result.success("","绑定成功"):Result.error("","绑定失败");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package com.health.system.server.mapper;
|
package com.health.system.server.mapper;
|
||||||
|
|
||||||
|
import com.health.system.common.domain.IdCard;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -10,4 +11,5 @@ import org.apache.ibatis.annotations.Mapper;
|
||||||
*/
|
*/
|
||||||
@Mapper
|
@Mapper
|
||||||
public interface SysIdCardMapper {
|
public interface SysIdCardMapper {
|
||||||
|
int insertIdCard(IdCard idCard);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
package com.health.system.server.service;
|
package com.health.system.server.service;
|
||||||
|
|
||||||
|
import com.health.system.common.domain.IdCard;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author 冯凯
|
* @author 冯凯
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
|
@ -7,4 +9,5 @@ package com.health.system.server.service;
|
||||||
* @date 2023/10/28 15:08
|
* @date 2023/10/28 15:08
|
||||||
*/
|
*/
|
||||||
public interface SysIdCardService {
|
public interface SysIdCardService {
|
||||||
|
Boolean insertIdCard(IdCard idCard);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package com.health.system.server.service.impl;
|
package com.health.system.server.service.impl;
|
||||||
|
|
||||||
|
import com.health.system.common.domain.IdCard;
|
||||||
import com.health.system.server.mapper.SysIdCardMapper;
|
import com.health.system.server.mapper.SysIdCardMapper;
|
||||||
import com.health.system.server.service.SysIdCardService;
|
import com.health.system.server.service.SysIdCardService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
@ -19,4 +20,9 @@ public class SysIdCardServiceImpl implements SysIdCardService {
|
||||||
*/
|
*/
|
||||||
@Autowired
|
@Autowired
|
||||||
private SysIdCardMapper sysIdCardMapper;
|
private SysIdCardMapper sysIdCardMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Boolean insertIdCard(IdCard idCard) {
|
||||||
|
return sysIdCardMapper.insertIdCard(idCard)>0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,4 +3,54 @@
|
||||||
<mapper namespace="com.health.system.server.mapper.SysIdCardMapper">
|
<mapper namespace="com.health.system.server.mapper.SysIdCardMapper">
|
||||||
|
|
||||||
|
|
||||||
|
<insert id="insertIdCard">
|
||||||
|
insert into tb_idcard
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="userId!=null">
|
||||||
|
user_id,
|
||||||
|
</if>
|
||||||
|
<if test="sex!=null and sex!=''" >
|
||||||
|
sex,
|
||||||
|
</if>
|
||||||
|
<if test="nation!=null and nation!=''" >
|
||||||
|
nation,
|
||||||
|
</if>
|
||||||
|
<if test="birthday!=null and birthday!=''" >
|
||||||
|
birthday,
|
||||||
|
</if>
|
||||||
|
<if test="address!=null and address!=''" >
|
||||||
|
address,
|
||||||
|
</if>
|
||||||
|
<if test="idNumber!=null and idNumber!=''" >
|
||||||
|
id_number,
|
||||||
|
</if>
|
||||||
|
<if test="issueOffice!=null and issueOffice!=''" >
|
||||||
|
issue_office,
|
||||||
|
</if>
|
||||||
|
</trim>
|
||||||
|
values
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="userId!=null">
|
||||||
|
#{userId},
|
||||||
|
</if>
|
||||||
|
<if test="sex!=null and sex!=''" >
|
||||||
|
#{sex},
|
||||||
|
</if>
|
||||||
|
<if test="nation!=null and nation!=''" >
|
||||||
|
#{nation},
|
||||||
|
</if>
|
||||||
|
<if test="birthday!=null and birthday!=''" >
|
||||||
|
#{birthday},
|
||||||
|
</if>
|
||||||
|
<if test="address!=null and address!=''" >
|
||||||
|
#{address},
|
||||||
|
</if>
|
||||||
|
<if test="idNumber!=null and idNumber!=''" >
|
||||||
|
#{idNumber},
|
||||||
|
</if>
|
||||||
|
<if test="issueOffice!=null and issueOffice!=''" >
|
||||||
|
#{issueOffice},
|
||||||
|
</if>
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
Loading…
Reference in New Issue