/**
* 增加批量导入映射.
*
* @param
* @return
*/
@Action(value = "addImportMapper", results = { @Result(name = "addImportMapper", type = "json", params = {
"root", "jsonResult" }) })
public String addImportMapper() {
Boolean operateResult = getImportMapperService().addImportMapper(
assembleParameterToAddImportMapper());
Map<String, Object> map = new HashMap<String, Object>();
map.put("result", operateResult);
jsonResult = map;
return "addImportMapper";
}
/**
* 由于是对外提供接口,不宜显式地暴露对象. <br/>
* 故将参数组装成对象.
*
* @return
*/
@SuppressWarnings("unchecked")
private ImportMapper assembleParameterToAddImportMapper() {
ImportMapper importMapper = new ImportMapper();
importMapper.setUuid(UUIDGenerator.genUuidStr());
importMapper.setMapperName("教职工姓名");
importMapper.setMatchedOrgUuid("123456");
importMapper.setMapperRule("name=>name,age=>20"); //hstore类型
importMapper.setCreatorUuid("789456");
return importMapper;
}
<insert id="insertImportMapper"
parameterType="net.firstelite.bicp.dtd.personnel$manage.system.ImportMapper">
insert into t_pm_sys_import_mapper (
uuid,
mapper_name,
matched_org_uuid,
mapper_rule,
creator_uuid,
create_time,
modify_time
)values(
#{uuid},
#{mapperName},
#{matchedOrgUuid},
#{mapperRule},
#{creatorUuid},
current_timestamp(0),
current_timestamp(0)
)
</insert>