屹宏电梯阶段图节点台账信息开发
parent
1e754843ff
commit
65ebec9fa3
|
@ -2603,6 +2603,17 @@ public class Util extends weaver.general.Util {
|
|||
return mdu.getModeDataNewId(tableName, formModeId, userId, 0, TimeUtil.getCurrentDateString(), TimeUtil.getOnlyCurrentTimeString());
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取建模表数据ID
|
||||
*
|
||||
* @param tableName 表名
|
||||
* @param userId 用户ID
|
||||
* @return 数据ID
|
||||
*/
|
||||
public static int getModeDataId(String tableName, int userId) {
|
||||
return mdu.getModeDataNewId(tableName, Integer.parseInt(getModeIdByTableName(tableName)), userId, 0, TimeUtil.getCurrentDateString(), TimeUtil.getOnlyCurrentTimeString());
|
||||
}
|
||||
|
||||
/**
|
||||
* 建模表数据权限重构
|
||||
*
|
||||
|
@ -2614,6 +2625,17 @@ public class Util extends weaver.general.Util {
|
|||
MODE_RIGHT_INFO.rebuildModeDataShareByEdit(userId, formId, id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 建模表数据权限重构
|
||||
*
|
||||
* @param userId 用户ID
|
||||
* @param tableName 表单名称
|
||||
* @param id 数据ID
|
||||
*/
|
||||
public static void rebuildModeDataShare(Integer userId, String tableName, Integer id) {
|
||||
MODE_RIGHT_INFO.rebuildModeDataShareByEdit(userId, Integer.parseInt(getModeIdByTableName(tableName)), id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 异步权限重构数据
|
||||
*
|
||||
|
@ -2625,6 +2647,17 @@ public class Util extends weaver.general.Util {
|
|||
threadPool.execute(() -> Util.rebuildModeDataShare(userId, formId, id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 异步权限重构数据
|
||||
*
|
||||
* @param userId 用户ID
|
||||
* @param tableName 表单名称
|
||||
* @param id 数据ID
|
||||
*/
|
||||
public static void rebuildModeDataShareByAsync(Integer userId, String tableName, Integer id) {
|
||||
threadPool.execute(() -> Util.rebuildModeDataShare(userId, Integer.parseInt(getModeIdByTableName(tableName)), id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 异步权限重构数据
|
||||
*
|
||||
|
@ -2641,6 +2674,22 @@ public class Util extends weaver.general.Util {
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* 异步权限重构数据
|
||||
*
|
||||
* @param userId 用户ID
|
||||
* @param tableName 表单名称
|
||||
* @param idList 数据ID
|
||||
*/
|
||||
public static void rebuildModeDataShareByAsyncList(Integer userId, String tableName, List<Integer> idList) {
|
||||
threadPool.execute(() -> {
|
||||
for (Integer id : idList) {
|
||||
Util.rebuildModeDataShare(userId, Integer.parseInt(getModeIdByTableName(tableName)), id);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 生成文件并创建文档信息,权限继承文档目录
|
||||
*
|
||||
|
@ -3594,9 +3643,11 @@ public class Util extends weaver.general.Util {
|
|||
}
|
||||
|
||||
|
||||
|
||||
public static String selectBillTableByFromId(String fromId) {
|
||||
return mapper.selectBillTableByFromId(fromId);
|
||||
}
|
||||
|
||||
public static void deleteModeId(String tableName, Integer dataId) {
|
||||
mapper.deleteModeId(tableName, dataId);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
package aiyh.utils.annotation.recordset;
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
/**
|
||||
* <h1>sql字段映射</h1>
|
||||
*
|
||||
* <p>create: 2023-02-07 17:31</p>
|
||||
*
|
||||
* @author youHong.ai
|
||||
*/
|
||||
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target(ElementType.FIELD)
|
||||
@Documented
|
||||
public @interface SqlDbFieldAnn {
|
||||
|
||||
String value();
|
||||
}
|
|
@ -138,15 +138,18 @@ public interface UtilMapper {
|
|||
@ParamMapper("configTableName") String configTableName);
|
||||
|
||||
/**
|
||||
*
|
||||
* <h2>selectBillTableByFromId 根据fromId查询billTable表明</h2>
|
||||
* <i>2023/2/6 13:40</i>
|
||||
* ************************************************************
|
||||
* @author youHong.ai
|
||||
*******************************************
|
||||
*
|
||||
* @param fromId fromId
|
||||
* @return String 表名
|
||||
* @author youHong.ai
|
||||
* ******************************************
|
||||
*/
|
||||
@Select("select * from workflow_bill where id = #{fromId}")
|
||||
String selectBillTableByFromId(@ParamMapper("fromId") String fromId);
|
||||
|
||||
@Delete("delete from $t{tableName} where id = #{dataId}")
|
||||
void deleteModeId(@ParamMapper("tableName") String tableName, @ParamMapper("dataId") Integer dataId);
|
||||
}
|
||||
|
|
|
@ -18,9 +18,11 @@ import java.lang.reflect.Field;
|
|||
public class BooleanTypeHandler implements TypeHandler {
|
||||
@Override
|
||||
public Object getValue(RecordSet rs, String fieldName, Field declaredField) {
|
||||
return getBoolean(declaredField, rs.getString(fieldName));
|
||||
return getBoolean(declaredField, GetRsValueUtil.getRsValue(rs, fieldName, declaredField));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public Object getValue(RecordSet rs, int index, Field declaredField) {
|
||||
return getBoolean(declaredField, rs.getString(index));
|
||||
|
@ -28,7 +30,7 @@ public class BooleanTypeHandler implements TypeHandler {
|
|||
|
||||
@Override
|
||||
public Object getValue(RecordSetTrans rs, String fieldName, Field declaredField) {
|
||||
return getBoolean(declaredField, rs.getString(fieldName));
|
||||
return getBoolean(declaredField, GetRsValueUtil.getRsValue(rs, fieldName, declaredField));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -26,7 +26,7 @@ public class DataTypeHandler implements TypeHandler {
|
|||
if (annotation != null) {
|
||||
String value = annotation.value();
|
||||
try {
|
||||
date = new SimpleDateFormat(value).parse(rs.getString(fieldName));
|
||||
date = new SimpleDateFormat(value).parse(GetRsValueUtil.getRsValue(rs, fieldName, declaredField));
|
||||
} catch (ParseException e) {
|
||||
e.printStackTrace();
|
||||
throw new TypeNonsupportException("Failed to convert [" + rs.getString(fieldName) + "] to a Date object as [" + value + "]!!");
|
||||
|
@ -64,7 +64,7 @@ public class DataTypeHandler implements TypeHandler {
|
|||
if (annotation != null) {
|
||||
String value = annotation.value();
|
||||
try {
|
||||
date = new SimpleDateFormat(value).parse(rs.getString(fieldName));
|
||||
date = new SimpleDateFormat(value).parse(GetRsValueUtil.getRsValue(rs, fieldName, declaredField));
|
||||
} catch (ParseException e) {
|
||||
e.printStackTrace();
|
||||
throw new TypeNonsupportException("Failed to convert [" + rs.getString(fieldName) + "] to a Date object as [" + value + "]!!");
|
||||
|
@ -91,4 +91,6 @@ public class DataTypeHandler implements TypeHandler {
|
|||
}
|
||||
return date;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -16,7 +16,7 @@ import java.lang.reflect.Field;
|
|||
public class FloatTypeHandler implements TypeHandler {
|
||||
@Override
|
||||
public Object getValue(RecordSet rs, String fieldName, Field declaredField) {
|
||||
String string = Util.null2DefaultStr(rs.getString(fieldName), "0.0");
|
||||
String string = Util.null2DefaultStr(GetRsValueUtil.getRsValue(rs, fieldName, declaredField), "0.0");
|
||||
return Float.parseFloat(string);
|
||||
}
|
||||
|
||||
|
@ -28,7 +28,7 @@ public class FloatTypeHandler implements TypeHandler {
|
|||
|
||||
@Override
|
||||
public Object getValue(RecordSetTrans rs, String fieldName, Field declaredField) {
|
||||
String string = Util.null2DefaultStr(rs.getString(fieldName), "0.0");
|
||||
String string = Util.null2DefaultStr(GetRsValueUtil.getRsValue(rs, fieldName, declaredField), "0.0");
|
||||
return Float.parseFloat(string);
|
||||
}
|
||||
|
||||
|
@ -37,4 +37,5 @@ public class FloatTypeHandler implements TypeHandler {
|
|||
String string = Util.null2DefaultStr(rs.getString(index), "0.0");
|
||||
return Float.parseFloat(string);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,44 @@
|
|||
package aiyh.utils.recordset;
|
||||
|
||||
import aiyh.utils.annotation.recordset.SqlDbFieldAnn;
|
||||
import org.h2.util.StringUtils;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import weaver.conn.RecordSet;
|
||||
import weaver.conn.RecordSetTrans;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
|
||||
/**
|
||||
* <h1>获取rs的值</h1>
|
||||
*
|
||||
* <p>create: 2023-02-07 17:36</p>
|
||||
*
|
||||
* @author youHong.ai
|
||||
*/
|
||||
|
||||
public class GetRsValueUtil {
|
||||
|
||||
@Nullable
|
||||
public static String getRsValue(RecordSet rs, String fieldName, Field declaredField) {
|
||||
String value = rs.getString(fieldName);
|
||||
if(StringUtils.isNullOrEmpty(value) && declaredField != null){
|
||||
SqlDbFieldAnn annotation = declaredField.getAnnotation(SqlDbFieldAnn.class);
|
||||
if (annotation != null){
|
||||
value = rs.getString(annotation.value());
|
||||
}
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static String getRsValue(RecordSetTrans rs, String fieldName, Field declaredField) {
|
||||
String value = rs.getString(fieldName);
|
||||
if(StringUtils.isNullOrEmpty(value) && declaredField != null){
|
||||
SqlDbFieldAnn annotation = declaredField.getAnnotation(SqlDbFieldAnn.class);
|
||||
if (annotation != null){
|
||||
value = rs.getString(annotation.value());
|
||||
}
|
||||
}
|
||||
return value;
|
||||
}
|
||||
}
|
|
@ -14,7 +14,7 @@ import java.lang.reflect.Field;
|
|||
public class IntegerTypeHandler implements TypeHandler {
|
||||
@Override
|
||||
public Object getValue(RecordSet rs, String fieldName, Field declaredField) {
|
||||
String string = Util.null2DefaultStr(rs.getString(fieldName), "-1");
|
||||
String string = Util.null2DefaultStr(GetRsValueUtil.getRsValue(rs, fieldName, declaredField), "-1");
|
||||
if (string.contains(".")) {
|
||||
string = string.substring(0, string.indexOf("."));
|
||||
}
|
||||
|
@ -32,7 +32,7 @@ public class IntegerTypeHandler implements TypeHandler {
|
|||
|
||||
@Override
|
||||
public Object getValue(RecordSetTrans rs, String fieldName, Field declaredField) {
|
||||
String string = Util.null2DefaultStr(rs.getString(fieldName), "-1");
|
||||
String string = Util.null2DefaultStr(GetRsValueUtil.getRsValue(rs, fieldName, declaredField), "-1");
|
||||
if (string.contains(".")) {
|
||||
string = string.substring(0, string.indexOf("."));
|
||||
}
|
||||
|
|
|
@ -13,7 +13,7 @@ import java.lang.reflect.Field;
|
|||
public class StringTypeHandler implements TypeHandler {
|
||||
@Override
|
||||
public Object getValue(RecordSet rs, String fieldName, Field declaredField) {
|
||||
return rs.getString(fieldName);
|
||||
return GetRsValueUtil.getRsValue(rs, fieldName, declaredField);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -23,7 +23,7 @@ public class StringTypeHandler implements TypeHandler {
|
|||
|
||||
@Override
|
||||
public Object getValue(RecordSetTrans rs, String fieldName, Field declaredField) {
|
||||
return rs.getString(fieldName);
|
||||
return GetRsValueUtil.getRsValue(rs, fieldName, declaredField);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -4,7 +4,7 @@ import aiyh.utils.Util;
|
|||
import com.alibaba.fastjson.JSON;
|
||||
import org.apache.log4j.Logger;
|
||||
import weaver.formmode.customjavacode.AbstractModeExpandJavaCodeNew;
|
||||
import weaver.youhong.ai.yihong.formmode.stagediagram.mapper.ModeExpandSaveActionMapper;
|
||||
import weaver.youhong.ai.yihong.formmode.stagediagram.service.ModeExpandSaveService;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
@ -21,13 +21,15 @@ public class ModeExpandSaveAction extends AbstractModeExpandJavaCodeNew {
|
|||
|
||||
private final Logger log = Util.getLogger();
|
||||
|
||||
private final ModeExpandSaveActionMapper mapper = Util.getMapper(ModeExpandSaveActionMapper.class);
|
||||
|
||||
@Override
|
||||
public Map<String, String> doModeExpand(Map<String, Object> param) {
|
||||
Map<String, String> result = new HashMap<>();
|
||||
Map<String, String> result = new HashMap<>(8);
|
||||
ModeExpandSaveService service = new ModeExpandSaveService();
|
||||
try {
|
||||
log.info("自定义接口保存动作参数: " + JSON.toJSONString(param));
|
||||
service.updateStageDiagramView(param,
|
||||
"STAGE_DIAGRAM_AMOUNT_TABLE", "STAGE_DIAGRAM_PROJECT_ID_FIELD",
|
||||
"STAGE_DIAGRAM_AMOUNT_FIELD");
|
||||
} catch (Exception e) {
|
||||
result.put("errmsg", e.getMessage());
|
||||
result.put("flag", "false");
|
||||
|
|
|
@ -0,0 +1,38 @@
|
|||
package weaver.youhong.ai.yihong.formmode.stagediagram.dto;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
|
||||
/**
|
||||
* <h1>项目节点台账信息</h1>
|
||||
*
|
||||
* <p>create: 2023/2/8 10:53</p>
|
||||
*
|
||||
* @author youHong.ai
|
||||
*/
|
||||
@Setter
|
||||
@Getter
|
||||
@ToString
|
||||
public class StageNodeInfo {
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
private Integer id;
|
||||
|
||||
/**
|
||||
* 项目id
|
||||
*/
|
||||
private String projectId;
|
||||
|
||||
/**
|
||||
* 金额
|
||||
*/
|
||||
private String amount;
|
||||
|
||||
/**
|
||||
* 当前节点
|
||||
*/
|
||||
private String currentNode;
|
||||
}
|
|
@ -1,6 +1,12 @@
|
|||
package weaver.youhong.ai.yihong.formmode.stagediagram.mapper;
|
||||
|
||||
import aiyh.utils.annotation.recordset.ParamMapper;
|
||||
import aiyh.utils.annotation.recordset.Select;
|
||||
import aiyh.utils.annotation.recordset.SqlMapper;
|
||||
import aiyh.utils.annotation.recordset.Update;
|
||||
import weaver.youhong.ai.yihong.formmode.stagediagram.dto.StageNodeInfo;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <h1></h1>
|
||||
|
@ -11,6 +17,47 @@ import aiyh.utils.annotation.recordset.SqlMapper;
|
|||
*/
|
||||
|
||||
@SqlMapper
|
||||
public class ModeExpandSaveActionMapper {
|
||||
public interface ModeExpandSaveActionMapper {
|
||||
|
||||
/**
|
||||
* <h2>查询台账信息</h2>
|
||||
*
|
||||
* @param projectId 项目id
|
||||
* @return 项目台账信息
|
||||
*/
|
||||
@Select("select * from uf_stage_node_info where project_id = #{projectId}")
|
||||
StageNodeInfo selectStageNodeInfoByProjectId(@ParamMapper("projectId") String projectId);
|
||||
|
||||
/**
|
||||
* <h2>根据唯一标识查询配置表主表ID </h2>
|
||||
*
|
||||
* @param onlyMark 唯一标识
|
||||
* @return 主表id
|
||||
*/
|
||||
@Select("select id from uf_yh_stage_diagram where only_mark = #{onlyMark}")
|
||||
Integer selectConfigMainId(@ParamMapper("onlyMark") String onlyMark);
|
||||
|
||||
/**
|
||||
* <h2>查询配置表明细表信息</h2>
|
||||
*
|
||||
* @param formId 表单id
|
||||
* @return 明细id
|
||||
*/
|
||||
// @Select("select * from uf_yh_stage_diagram_dt1 where mainid = #{mainId} and model_table = #{formId]")
|
||||
// Map<String, Object> selectDetailConfig(@ParamMapper("mainId") Integer mainId, @ParamMapper("formId") String formId);
|
||||
@Select("select * from uf_yh_stage_diagram_dt1 where model_table = #{formId}")
|
||||
Map<String, Object> selectDetailConfig(@ParamMapper("formId") String formId);
|
||||
|
||||
@Select("select $t{amountField} from $t{amountTable} where $t{projectIdField} = #{projectId}")
|
||||
String selectAmountByProjectId(@ParamMapper("projectId") String projectId,
|
||||
@ParamMapper("projectIdField") String projectIdField,
|
||||
@ParamMapper("amountTable") String amountTable,
|
||||
@ParamMapper("amountField") String amountField);
|
||||
|
||||
@Update("update uf_stage_node_info set project_id = #{projectId}, amount = #{amount}, " +
|
||||
"current_node = #{nodeName} where id = #{dataId}")
|
||||
boolean updateStageNodeInfo(@ParamMapper("dataId") Integer dataId,
|
||||
@ParamMapper("projectId") String projectId,
|
||||
@ParamMapper("nodeName") String nodeName,
|
||||
@ParamMapper("amount") String amount);
|
||||
}
|
||||
|
|
|
@ -2,15 +2,18 @@ package weaver.youhong.ai.yihong.formmode.stagediagram.service;
|
|||
|
||||
import aiyh.utils.Util;
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import weaver.soa.workflow.request.Property;
|
||||
import weaver.soa.workflow.request.RequestInfo;
|
||||
import weaver.youhong.ai.yihong.formmode.stagediagram.dto.StageNodeInfo;
|
||||
import weaver.youhong.ai.yihong.formmode.stagediagram.mapper.ModeExpandSaveActionMapper;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* <h1>保存自定义处理方法service</h1>
|
||||
|
@ -26,15 +29,56 @@ public class ModeExpandSaveService {
|
|||
|
||||
private final ModeExpandSaveActionMapper mapper = Util.getMapper(ModeExpandSaveActionMapper.class);
|
||||
|
||||
public void updateStageDiagramView(String projectFieldMark, Map<String, Object> param){
|
||||
public void updateStageDiagramView(Map<String, Object> param,
|
||||
String amountTable,
|
||||
String projectIdField,
|
||||
String amountField) {
|
||||
/* ******************* 查询当前节点对应的projectId ******************* */
|
||||
String stageDiagramProjectFieldName = Util.getCusConfigValue(projectFieldMark);
|
||||
String formId = Util.null2String(param.get("formId"));
|
||||
Map<String, Object> currentNodeConfig = mapper.selectDetailConfig(formId);
|
||||
// String stageDiagramProjectFieldName = Util.getCusConfigValue(projectFieldMark);
|
||||
String stageDiagramProjectFieldName = Util.null2String(currentNodeConfig.get("projectFieldName"));
|
||||
Assert.notBlank(stageDiagramProjectFieldName, "cna not find projectFieldMark from uf_cus_dev_config! the config can not be null!");
|
||||
RequestInfo requestInfo = (RequestInfo) param.get("RequestInfo");
|
||||
Map<String, String> mainTableValue = getMainTableValue(requestInfo);
|
||||
String projectId = mainTableValue.get(stageDiagramProjectFieldName);
|
||||
log.info("主表数据:" + JSON.toJSONString(mainTableValue));
|
||||
// 获取当前模块id
|
||||
/* ******************* 查询台账中对应的project是否存在, 台账中不存在则插入,存在则更新 ******************* */
|
||||
StageNodeInfo nodeInfo = mapper.selectStageNodeInfoByProjectId(projectId);
|
||||
log.info("查询到的nodeINFo数据:" + JSON.toJSONString(nodeInfo));
|
||||
if (Objects.isNull(nodeInfo)) {
|
||||
// 不存在项目信息在台账中插入项目信息到台账信息中
|
||||
Integer dataId = Util.getModeDataId("uf_stage_node_info", 1);
|
||||
// 查询配置表信息
|
||||
// Integer mainId = mapper.selectConfigMainId(Util.getCusConfigValue(onlyMarkCusMark));
|
||||
// Map<String, Object> currentNodeConfig = mapper.selectDetailConfig(mainId, formId);
|
||||
String nodeName = (String) currentNodeConfig.get("nodeName");
|
||||
log.info("节点名称: " + nodeName);
|
||||
String amount = mapper.selectAmountByProjectId(projectId,
|
||||
Util.getCusConfigValueNullOrEmpty(projectIdField, ""),
|
||||
Util.getCusConfigValueNullOrEmpty(amountTable, ""),
|
||||
Util.getCusConfigValueNullOrEmpty(amountField, ""));
|
||||
|
||||
boolean update = mapper.updateStageNodeInfo(dataId, projectId, nodeName, amount);
|
||||
if (!update) {
|
||||
Util.deleteModeId("uf_stage_node_info", dataId);
|
||||
} else {
|
||||
Util.rebuildModeDataShare(1, Integer.parseInt(Util.getModeIdByTableName("uf_stage_node_info")),
|
||||
dataId);
|
||||
}
|
||||
} else {
|
||||
// 存在,更新当前项目的节点信息
|
||||
Integer dataId = nodeInfo.getId();
|
||||
// Integer mainId = mapper.selectConfigMainId(Util.getCusConfigValue(onlyMarkCusMark));
|
||||
// Map<String, Object> currentNodeConfig = mapper.selectDetailConfig(mainId, formId);
|
||||
String nodeName = (String) currentNodeConfig.get("nodeName");
|
||||
String amount = mapper.selectAmountByProjectId(projectId,
|
||||
Util.getCusConfigValueNullOrEmpty(projectIdField, ""),
|
||||
Util.getCusConfigValueNullOrEmpty(amountTable, ""),
|
||||
Util.getCusConfigValueNullOrEmpty(amountField, ""));
|
||||
mapper.updateStageNodeInfo(dataId, projectId, nodeName, amount);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -54,7 +98,7 @@ public class ModeExpandSaveService {
|
|||
if (null == propertyArr) {
|
||||
return Collections.emptyMap();
|
||||
}
|
||||
Map<String, String> mainTable = new HashMap<>();
|
||||
Map<String, String> mainTable = new HashMap<>(8);
|
||||
for (Property property : propertyArr) {
|
||||
String fieldName = property.getName();
|
||||
String value = property.getValue();
|
||||
|
|
|
@ -72,4 +72,11 @@ public class UtilTest extends BaseTest {
|
|||
"3\t7738\t看剧方\t加上撒u给你\t真个吧\t736\n" +
|
||||
"4\t83\t就啊啥地方\t纪念活动\t你先给你\t6383";
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void testResUtil(){
|
||||
TransTestMapper mapper = Util.getMapper(TransTestMapper.class);
|
||||
System.out.println(mapper.selectStudent());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package youhong.ai.pcn.mapper;
|
||||
|
||||
import aiyh.utils.annotation.recordset.Insert;
|
||||
import aiyh.utils.annotation.recordset.Select;
|
||||
import aiyh.utils.annotation.recordset.SqlMapper;
|
||||
import youhong.ai.pcn.pojo.Student;
|
||||
|
||||
|
@ -17,4 +18,10 @@ public interface TransTestMapper {
|
|||
|
||||
@Insert("insert into test_trans (name,age,sex) values (#{name},#{age},#{sex})")
|
||||
boolean insertStudent(Student student);
|
||||
|
||||
|
||||
|
||||
|
||||
@Select("select id, tablename a, namelabel b, uuid c from workflow_bill where id = -43")
|
||||
Student selectStudent();
|
||||
}
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
package youhong.ai.pcn.pojo;
|
||||
|
||||
import aiyh.utils.annotation.recordset.SqlDbFieldAnn;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
|
||||
/**
|
||||
* <h1></h1>
|
||||
|
@ -13,9 +15,20 @@ import lombok.Setter;
|
|||
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
public class Student {
|
||||
private int id;
|
||||
|
||||
@SqlDbFieldAnn("a")
|
||||
private String name;
|
||||
|
||||
|
||||
@SqlDbFieldAnn("b")
|
||||
private String test;
|
||||
|
||||
@SqlDbFieldAnn("c")
|
||||
private String bcd;
|
||||
|
||||
private int age;
|
||||
private int sex;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue