作者:钟剑华  历史版本:1  更新时间:2024-06-15 15:03

适用版本:所有版本;
完整类名:com.lc.ibps.platform.script.script.BusinessScript

适用哪些服务?

  1. 通过business

调用方式例子

  • 查询数据
import java.util.HashMap;
import java.util.Map;

Map<String, String> params = new HashMap<>();
params.put("ming_cheng_", "id_");
params.put("shu_liang_", "ku_cun_");
// 根据数据主键,获取源表的某些字段,写入目标表的对应字段
businessScript.syncNumberDataBySql(businessKey_, "t_enterdetail", "parent_id_", "ming_cheng_", "t_consumablesbasic", "id_", params, true);

常用方法



/**
 * MySQL特性方法
 * 根据日期查询条件获取相关信息,进行更新对应的表单信息(带事务回滚)
 * @param queryTableName 查询表单
 * @param queryParams 查询字段
 * @List<String> groupParams 分组字段
 * @param updateTableName 更新表名
 * @param updateMap 更新字段
 * @param whereMap 条件字段信息
 * @param isLess 日期小于还是大于,默认小于即true
 * eg:update t_consumable c inner join(
 *     select consumable_code_ ,consumable_name_,effective_date_ 
 *     from t_stock  where effective_date_>now() GROUP BY consumable_code_) s 
 *     on c.code_ = s.consumable_code_ set c.expire_warning_ = '2';
 */
public void updateDataByQueryDate(boolean isLess,BusinessTargetTableVo ... tableVos);

/**
 * MySQL特性方法
 * 根据日期查询条件获取相关信息,进行更新对应的表单信息
 * @param queryTableName 查询表单
 * @param queryParams 查询字段
 * @List<String> groupParams 分组字段
 * @param updateTableName 更新表名
 * @param updateMap 更新字段
 * @param whereMap 条件字段信息
 * @param isLess 日期小于还是大于,默认小于即true
 * <pre>
 * BusinessTargetTableVo consumableVo = new BusinessTargetTableVo("t_stock","s","t_consumable","c","consumable_code_","code_");
 *List<String> queryParams = new ArrayList<String>();
 *consumableVo.setQueryParams(queryParams);
 *queryParams.add("consumable_code_");
 *queryParams.add("consumable_name_");
 *queryParams.add("effective_date_");
 *List<String> groupByParams = new ArrayList<String>();
 *consumableVo.setGroupParams(groupByParams);
 *groupByParams.add("consumable_code_");
 *
 *Map<String, Object> whereParams = new HashMap<String, Object>();
 *consumableVo.setWhereParams(whereParams);
 *whereParams.put("effective_date_","null");

 *Map<String,Object> updateMap = new HashMap<String, Object>();
 *consumableVo.setUpdateMap(updateMap);
 *updateMap.put("expire_warning_","2");
 *businessScript.updateDataByQueryDate(true,consumableVo);
 * 
 * </pre>
 * eg:update t_consumable c inner join(
 *     select consumable_code_ ,consumable_name_,effective_date_ 
 *     from t_stock  where effective_date_>now() GROUP BY consumable_code_) s 
 *     on c.code_ = s.consumable_code_ set c.expire_warning_ = '2';
 */
public void updateDataByQueryDate(boolean isLess,Map<String, List<Object[]>> sqls,BusinessTargetTableVo ... tableVos);

/**
 * 根据数据主键,获取源表的某些字段,写入目标表的对应字段,目标表必须存在关联数据记录(不会自动创建数据)
 * <pre>
 *  import java.util.HashMap;
 *    import java.util.Map;
 *    
 *    Map<String, String> params = new HashMap<>();
 *    params.put("ming_cheng_", "id_");
 *    params.put("shu_liang_", "ku_cun_");
 *    businessScript.syncNumberDataBySql(businessKey_, "t_enterdetail", "parent_id_", "ming_cheng_", "t_consumablesbasic", "id_", params, true);
 * </pre>
 * 
 * @param identify    数据标识
 * @param sourceTableName    源表名称
 * @param sourceIdentifyField    源表标识字段
 * @param sourceLinkField    源表与目标表关联的字段
 * @param targetTableName    目标表名称
 * @param targetIdentifyField    目标表标识字段(用于更新数据)
 * @param params    字段对应配置
 * @param isIncrease    数据是否执行增加,true增加/false减少
 */
public void syncNumberDataBySql(String identify, String sourceTableName, String sourceIdentifyField, String sourceLinkField, 
        String targetTableName, String targetIdentifyField, Map<String, String> params, boolean isIncrease);

/**
 * 根据数据主键,获取源表的某些字段,写入目标表的对应字段,目标表必须存在关联数据记录(不会自动创建数据)
 * <pre>
 *  import java.util.HashMap;
 *    import java.util.Map;
 *    
 *    Map<String, String> params = new HashMap<>();
 *    params.put("ming_cheng_", "id_");
 *    params.put("shu_liang_", "ku_cun_");
 *    businessScript.syncNumberDataBySql(businessKey_, "t_enterdetail", "parent_id_", "ming_cheng_", "t_consumablesbasic", "id_", params, true);
 * </pre>
 * 
 * @param identify    数据标识
 * @param sourceTableName    源表名称
 * @param sourceIdentifyField    源表标识字段
 * @param sourceLinkField    源表与目标表关联的字段
 * @param targetTableName    目标表名称
 * @param targetIdentifyField    目标表标识字段(用于更新数据)
 * @param params    字段对应配置
 * @param isIncrease    数据是否执行增加,true增加/false减少
 * TODO 待验证
 */
public void syncNumberDataBySql(String identify, String sourceTableName, String sourceIdentifyField, String sourceLinkField, 
        String targetTableName, String targetIdentifyField, Map<String, String> params, boolean isIncrease, Map<String, List<Object[]>> sqls);

/**
 * 根据数据主键,获取源表的某些字段,写入目标表的对应字段,目标表必须存在关联数据记录(不会自动创建数据)
 * <pre>
 *  import java.util.HashMap;
 *    import java.util.Map;
 *    
 *    Map<String, String> linkParams = new HashMap<>();
 *    linkParams.put("hao_cai_bian_ma_", "bian_hao_");
 *    linkParams.put("pi_ci_", "pi_ci_");
 *
 *    Map<String, String> params = new HashMap<>();
 *    params.put("shu_liang_", "batch_num_");
 *    businessScript.syncNumberDataBySql(businessKey_, "t_enterdetail", "t_consumablesbasic", linkParams, params, true);
 * </pre>
 * 
 * @param identify    数据标识
 * @param sourceTableName    源表名称
 * @param targetTableName    目标表名称
 * @param targetIdentifyField    目标表标识字段(用于更新数据)
 * @param identifyFieldMap    组合字段配置
 * @param params    字段对应配置
 * @param isIncrease    数据是否执行增加,true增加/false减少
 */
public void syncNumberDataBySql(String identify, 
        String sourceTableName, String sourceTableIdentifyField, String sourceIdentifyField, 
        String targetTableName, String targetIdentifyField, 
        Map<String, String> identifyFieldMap, Map<String, String> params, boolean isIncrease,
        TargetTableVo ... tableVos);

/**
 * 根据数据主键,获取源表的某些字段,写入目标表的对应字段,目标表必须存在关联数据记录(不会自动创建数据)
 * <pre>
 *  import java.util.HashMap;
 *    import java.util.Map;
 *    
 *    Map<String, String> linkParams = new HashMap<>();
 *    linkParams.put("hao_cai_bian_ma_", "bian_hao_");
 *    linkParams.put("pi_ci_", "pi_ci_");
 *
 *    Map<String, String> params = new HashMap<>();
 *    params.put("shu_liang_", "batch_num_");
 *    businessScript.syncNumberDataBySql(businessKey_, "t_enterdetail", "t_consumablesbasic", linkParams, params, true);
 * </pre>
 * 
 * @param identify    数据标识
 * @param sourceTableName    源表名称
 * @param targetTableName    目标表名称
 * @param targetIdentifyField    目标表标识字段(用于更新数据)
 * @param identifyFieldMap    组合字段配置
 * @param params    字段对应配置
 */
public void syncNumberDataAndUpdateTotalBySql(String identify, 
        String sourceTableName, String sourceTableIdentifyField, String sourceIdentifyField, 
        String targetTableName, String targetIdentifyField, 
        Map<String, String> identifyFieldMap, Map<String, String> params, 
        TargetTableVo[] tableVos, Map<String, String> params0, TargetTableVo[] tableUpdateTotalVos);

/**
 * 根据数据主键,获取源表的某些字段,写入目标表的对应字段,目标表必须存在关联数据记录(不会自动创建数据)
 * <pre>
 *  import java.util.HashMap;
 *    import java.util.Map;
 *    
 *    Map<String, String> linkParams = new HashMap<>();
 *    linkParams.put("hao_cai_bian_ma_", "bian_hao_");
 *    linkParams.put("pi_ci_", "pi_ci_");
 *
 *    Map<String, String> params = new HashMap<>();
 *    params.put("shu_liang_", "batch_num_");
 *    businessScript.syncNumberDataBySql(businessKey_, "t_enterdetail", "t_consumablesbasic", linkParams, params, true);
 * </pre>
 * 
 * @param identify    数据标识
 * @param sourceTableName    源表名称
 * @param targetTableName    目标表名称
 * @param targetIdentifyField    目标表标识字段(用于更新数据)
 * @param identifyFieldMap    组合字段配置
 * @param params    字段对应配置
 * @param isIncrease    数据是否执行增加,true增加/false减少
 * TODO 待验证
 */
@SuppressWarnings({ "rawtypes", "unchecked" })
public void syncNumberDataBySql(String identify, 
        String sourceTableName, String sourceTableIdentifyField, String sourceIdentifyField, 
        String targetTableName, String targetIdentifyField, 
        Map<String, String> identifyFieldMap, Map<String, String> params, boolean isIncrease, Map<String, List<Object[]>> sqls,
        TargetTableVo ... tableVos);

/**
 * 根据字段配置,获取源表的某些字段,写入目标表的对应字段,目标表必须存在关联数据记录(会自动创建数据)
 * <pre>
 *    import java.util.Date;
 *  import java.util.HashMap;
 *    import java.util.Map;
 *    import com.lc.ibps.base.framework.id.UniqueIdUtil;
 *    
 *    Map<String, String> params = new HashMap<>();
 *    params.put("id_", UniqueIdUtil.getId());
 *    params.put("pan_dian_ri_qi_", new Date());
 *    params.put("zhuang_tai_", "1");
 *
 *    Map<String, String> subParams = new HashMap<>();
 *    subParams.put("ming_cheng_", "ming_cheng_");
 *    subParams.put("gui_ge_", "gui_ge_");
 *    subParams.put("pi_ci_", "pi_ci_");
 *    subParams.put("batch_remaining_", "ku_cun_");
 *    subParams.put("you_xiao_qi_", "you_xiao_qi_");
 *    subParams.put("manufacturer_", "factory_");
 *    businessScript.syncDataBySql("t_kcpdzb", params, "t_hcpcglb", "t_kcpdb", "id_", "id_", "parent_id_", subParams);
 * </pre>
 *
 * @param targetTableName    目标表名称
 * @param params    字段值设置
 * @param sourceSubTableName    源表子表表名称
 * @param targetSubTableName    目标表子表表名称
 * @param sourceIdentifyField    源子表标识字段(用于更新数据)
 * @param targetSubIdentify        目标子表标识字段(用于更新数据)
 * @param targetSubIdentifyField    目标子表标识字段(用于更新数据)
 * @param subParams    字段对应配置
 * @return 
 */
public String syncDataBySql(
        String targetTableName, Map<String, Object> params, 
        String sourceSubTableName, 
        String targetSubTableName, String sourceIdentifyField, String targetSubIdentify, String targetSubIdentifyField, Map<String, String> subParams);

/**
 * 根据字段配置,获取源表的某些字段,写入目标表的对应字段,目标表必须存在关联数据记录(会自动创建数据)
 * <pre>
 *    import java.util.Date;
 *  import java.util.HashMap;
 *    import java.util.Map;
 *    import com.lc.ibps.base.framework.id.UniqueIdUtil;
 *    
 *    Map<String, String> params = new HashMap<>();
 *    params.put("id_", UniqueIdUtil.getId());
 *    params.put("pan_dian_ri_qi_", new Date());
 *    params.put("zhuang_tai_", "1");
 *
 *    Map<String, String> subParams = new HashMap<>();
 *    subParams.put("ming_cheng_", "ming_cheng_");
 *    subParams.put("gui_ge_", "gui_ge_");
 *    subParams.put("pi_ci_", "pi_ci_");
 *    subParams.put("batch_remaining_", "ku_cun_");
 *    subParams.put("you_xiao_qi_", "you_xiao_qi_");
 *    subParams.put("manufacturer_", "factory_");
 *    businessScript.syncDataBySql("t_kcpdzb", params, "t_hcpcglb", "t_kcpdb", "id_", "id_", "parent_id_", subParams);
 * </pre>
 *
 * @param targetTableName    目标表名称
 * @param params    字段值设置
 * @param sourceSubTableName    源表子表表名称
 * @param targetSubTableName    目标表子表表名称
 * @param sourceIdentifyField    源子表标识字段(用于更新数据)
 * @param targetSubIdentify        目标子表标识字段(用于更新数据)
 * @param targetSubIdentifyField    目标子表标识字段(用于更新数据)
 * @param subParams    字段对应配置
 * @return 
 * TODO 待验证
 */
public String syncDataBySql(
        String targetTableName, Map<String, Object> params, 
        String sourceSubTableName, 
        String targetSubTableName, String sourceIdentifyField, String targetSubIdentify, String targetSubIdentifyField, 
        Map<String, String> subParams, Map<String, List<Object[]>> sqls);

/**
 * 根据主从表分发数据
 * <pre>
 *  1:登记主表:t_registrationList,字段:主键:id_,登录流水号:register_serial_
*   2:源头从表:样本明细:t_sampleDetails,字段:样本编号:sample_num_,数量:shu_liang_,检查项目:jian_ce_xiang_mu_
*   3:写入原始样本明细:t_originalSampleDetails,将源头从表的字段信息根据数量循环添加到该表:
*      源头表:t_sampleDetails,字段:全字段
*      原始样本明细:t_originalSampleDetails,字段:一一对应
*      a、原始样本编号:old_sample_num_(sample_bian_hao_+数量,从01开始计算,结合组合范例: 样本编号+‘—’+01)
*      b、状态:zhuang_tai_(“1”)
*      c、流水号:register_serial_(主表字段)
*   4:写入分子特检:t_elememtSpecial,根据源头表样本编号+检查项目循环插入字段信息
*      源头表:t_sampleDetails,字段:外键:parent_id_、样本编号:sample_num_、样品类型:sample_type_、检查项目:jian_ce_xiang_mu_(值格式:1,2,3)
*      分子特检:t_elememtSpecial,字段:外键:parent_id_、样本编号:sample_num_、样本类型:sample_type_、检查项目:jian_ce_xiang_mu_(值格式:1,2,3)
*      a、用检查项目根据逗号隔开存储多条数据,1一条,2一条,3一条;
*      b、zhuang_tai_传入“1”
*      c、流水号:register_serial_(主表字段)
 * </pre>
 * <pre>
 * import com.lc.ibps.platform.script.script.vo.TargetTableVo;
* import java.util.HashMap;
* import java.util.Map;
* 
* TargetTableVo originalSampleDetailsTableVo = new TargetTableVo("parent_id_","t_sampleDetails","t_originalSampleDetails","id_","shu_liang_","old_sample_num_","count","{{FIELD:sample_num_}}-{{NUM:2:0}}");
* 
* Map<String, String> originalSampleDetailsFieldRelationMap = new HashMap<>();
* originalSampleDetailsTableVo.setFieldRelationMap(originalSampleDetailsFieldRelationMap);
* originalSampleDetailsFieldRelationMap.put("parent_id_", "parent_id_");
* originalSampleDetailsFieldRelationMap.put("sample_num_", "sample_num_");
* originalSampleDetailsFieldRelationMap.put("sample_type_", "sample_type_");
* originalSampleDetailsFieldRelationMap.put("jian_ce_xiang_mu_", "jian_ce_xiang_mu_");
* originalSampleDetailsFieldRelationMap.put("xiang_mu_ming_", "xiang_mu_ming_");
* originalSampleDetailsFieldRelationMap.put("yong_tu_", "yong_tu_");
* originalSampleDetailsFieldRelationMap.put("bao_cun_jie_zhi_", "bao_cun_jie_zhi_");
* originalSampleDetailsFieldRelationMap.put("sample_tube_type_", "sample_tube_type_");
* originalSampleDetailsFieldRelationMap.put("zhi_liang_", "zhi_liang_");
* originalSampleDetailsFieldRelationMap.put("zhi_liang_", "zhi_liang_");
* originalSampleDetailsFieldRelationMap.put("ti_ji_", "ti_ji_");
* originalSampleDetailsFieldRelationMap.put("nong_du_", "nong_du_");
*
* Map<String, Object> originalSampleDetailsFieldParams = new HashMap<>();
* originalSampleDetailsTableVo.setFieldParams(originalSampleDetailsFieldParams);
* originalSampleDetailsFieldParams.put("register_serial_", registerSerial);
* originalSampleDetailsFieldParams.put("zhuang_tai_", "1");
*
* TargetTableVo elememtSpecialTableVo = new TargetTableVo("parent_id_","t_sampleDetails","t_elememtSpecial","id_","jian_ce_xiang_mu_","jian_ce_xiang_mu_","char", "");
* 
* Map<String, String> elememtSpecialFieldRelationMap = new HashMap<>();
* elememtSpecialTableVo.setFieldRelationMap(elememtSpecialFieldRelationMap);
* elememtSpecialFieldRelationMap.put("parent_id_", "parent_id_");
* elememtSpecialFieldRelationMap.put("sample_num_", "sample_num_");
* elememtSpecialFieldRelationMap.put("sample_type_", "sample_type_");
* elememtSpecialFieldRelationMap.put("jian_ce_xiang_mu_", "jian_ce_xiang_mu_");
*
* Map<String, Object> elememtSpecialFieldParams = new HashMap<>();
* elememtSpecialTableVo.setFieldParams(elememtSpecialFieldParams);
* elememtSpecialFieldParams.put("register_serial_", registerSerial);
* elememtSpecialFieldParams.put("zhuang_tai_", "1");
* 
* businessScript.syncDataBySql("t_registrationList", "id_", id, originalSampleDetailsTableVo, elememtSpecialTableVo);
 * </pre>
 *
 * @param sourceTableName    源表名称
 * @param sourceTableIdentifyField    源表标识字段名
 * @param sourceTableIdentifyFieldValue    源表标识字段值
 * @param tableVos     操作表数组
 */
public void syncDataBySql(String sourceTableName, String sourceTableIdentifyField, String sourceTableIdentifyFieldValue
                        , TargetTableVo ... tableVos);

/**
 * 根据主从表分发数据
 * <pre>
 *  1:登记主表:t_registrationList,字段:主键:id_,登录流水号:register_serial_
*   2:源头从表:样本明细:t_sampleDetails,字段:样本编号:sample_num_,数量:shu_liang_,检查项目:jian_ce_xiang_mu_
*   3:写入原始样本明细:t_originalSampleDetails,将源头从表的字段信息根据数量循环添加到该表:
*      源头表:t_sampleDetails,字段:全字段
*      原始样本明细:t_originalSampleDetails,字段:一一对应
*      a、原始样本编号:old_sample_num_(sample_bian_hao_+数量,从01开始计算,结合组合范例: 样本编号+‘—’+01)
*      b、状态:zhuang_tai_(“1”)
*      c、流水号:register_serial_(主表字段)
*   4:写入分子特检:t_elememtSpecial,根据源头表样本编号+检查项目循环插入字段信息
*      源头表:t_sampleDetails,字段:外键:parent_id_、样本编号:sample_num_、样品类型:sample_type_、检查项目:jian_ce_xiang_mu_(值格式:1,2,3)
*      分子特检:t_elememtSpecial,字段:外键:parent_id_、样本编号:sample_num_、样本类型:sample_type_、检查项目:jian_ce_xiang_mu_(值格式:1,2,3)
*      a、用检查项目根据逗号隔开存储多条数据,1一条,2一条,3一条;
*      b、zhuang_tai_传入“1”
*      c、流水号:register_serial_(主表字段)
 * </pre>
 * <pre>
 * import com.lc.ibps.platform.script.script.vo.TargetTableVo;
* import java.util.HashMap;
* import java.util.Map;
* 
* TargetTableVo originalSampleDetailsTableVo = new TargetTableVo("parent_id_","t_sampleDetails","t_originalSampleDetails","id_","shu_liang_","old_sample_num_","count","{{FIELD:sample_num_}}-{{NUM:2:0}}");
* 
* Map<String, String> originalSampleDetailsFieldRelationMap = new HashMap<>();
* originalSampleDetailsTableVo.setFieldRelationMap(originalSampleDetailsFieldRelationMap);
* originalSampleDetailsFieldRelationMap.put("parent_id_", "parent_id_");
* originalSampleDetailsFieldRelationMap.put("sample_num_", "sample_num_");
* originalSampleDetailsFieldRelationMap.put("sample_type_", "sample_type_");
* originalSampleDetailsFieldRelationMap.put("jian_ce_xiang_mu_", "jian_ce_xiang_mu_");
* originalSampleDetailsFieldRelationMap.put("xiang_mu_ming_", "xiang_mu_ming_");
* originalSampleDetailsFieldRelationMap.put("yong_tu_", "yong_tu_");
* originalSampleDetailsFieldRelationMap.put("bao_cun_jie_zhi_", "bao_cun_jie_zhi_");
* originalSampleDetailsFieldRelationMap.put("sample_tube_type_", "sample_tube_type_");
* originalSampleDetailsFieldRelationMap.put("zhi_liang_", "zhi_liang_");
* originalSampleDetailsFieldRelationMap.put("zhi_liang_", "zhi_liang_");
* originalSampleDetailsFieldRelationMap.put("ti_ji_", "ti_ji_");
* originalSampleDetailsFieldRelationMap.put("nong_du_", "nong_du_");
*
* Map<String, Object> originalSampleDetailsFieldParams = new HashMap<>();
* originalSampleDetailsTableVo.setFieldParams(originalSampleDetailsFieldParams);
* originalSampleDetailsFieldParams.put("register_serial_", registerSerial);
* originalSampleDetailsFieldParams.put("zhuang_tai_", "1");
*
* TargetTableVo elememtSpecialTableVo = new TargetTableVo("parent_id_","t_sampleDetails","t_elememtSpecial","id_","jian_ce_xiang_mu_","jian_ce_xiang_mu_","char", "");
* 
* Map<String, String> elememtSpecialFieldRelationMap = new HashMap<>();
* elememtSpecialTableVo.setFieldRelationMap(elememtSpecialFieldRelationMap);
* elememtSpecialFieldRelationMap.put("parent_id_", "parent_id_");
* elememtSpecialFieldRelationMap.put("sample_num_", "sample_num_");
* elememtSpecialFieldRelationMap.put("sample_type_", "sample_type_");
* elememtSpecialFieldRelationMap.put("jian_ce_xiang_mu_", "jian_ce_xiang_mu_");
*
* Map<String, Object> elememtSpecialFieldParams = new HashMap<>();
* elememtSpecialTableVo.setFieldParams(elememtSpecialFieldParams);
* elememtSpecialFieldParams.put("register_serial_", registerSerial);
* elememtSpecialFieldParams.put("zhuang_tai_", "1");
* 
* businessScript.syncDataAndStartAgreeFlowBySql("t_registrationList", "id_", id, originalSampleDetailsTableVo, elememtSpecialTableVo);
 * </pre>
 *
 * @param sourceTableName    源表名称
 * @param sourceTableIdentifyField    源表标识字段名
 * @param sourceTableIdentifyFieldValue    源表标识字段值
 * @param flowKey    需要启动的流程key
 * @param isDoNext 是否需要执行下一步,默认true,需要执行
 * @param tableVos     操作表数组
 */
public void syncDataAndStartAgreeFlowBySql(String sourceTableName, String sourceTableIdentifyField, String sourceTableIdentifyFieldValue
                        , String flowKey,boolean isDoNext, TargetTableVo ... tableVos);

/**
 * 根据主从表分发数据
 * <pre>
 *  1:登记主表:t_registrationList,字段:主键:id_,登录流水号:register_serial_
*   2:源头从表:样本明细:t_sampleDetails,字段:样本编号:sample_num_,数量:shu_liang_,检查项目:jian_ce_xiang_mu_
*   3:写入原始样本明细:t_originalSampleDetails,将源头从表的字段信息根据数量循环添加到该表:
*      源头表:t_sampleDetails,字段:全字段
*      原始样本明细:t_originalSampleDetails,字段:一一对应
*      a、原始样本编号:old_sample_num_(sample_bian_hao_+数量,从01开始计算,结合组合范例: 样本编号+‘—’+01)
*      b、状态:zhuang_tai_(“1”)
*      c、流水号:register_serial_(主表字段)
*   4:写入分子特检:t_elememtSpecial,根据源头表样本编号+检查项目循环插入字段信息
*      源头表:t_sampleDetails,字段:外键:parent_id_、样本编号:sample_num_、样品类型:sample_type_、检查项目:jian_ce_xiang_mu_(值格式:1,2,3)
*      分子特检:t_elememtSpecial,字段:外键:parent_id_、样本编号:sample_num_、样本类型:sample_type_、检查项目:jian_ce_xiang_mu_(值格式:1,2,3)
*      a、用检查项目根据逗号隔开存储多条数据,1一条,2一条,3一条;
*      b、zhuang_tai_传入“1”
*      c、流水号:register_serial_(主表字段)
 * </pre>
 * <pre>
 * import com.lc.ibps.platform.script.script.vo.TargetTableVo;
* import java.util.HashMap;
* import java.util.Map;
* 
* TargetTableVo originalSampleDetailsTableVo = new TargetTableVo("parent_id_","t_sampleDetails","t_originalSampleDetails","id_","shu_liang_","old_sample_num_","count","{{FIELD:sample_num_}}-{{NUM:2:0}}");
* 
* Map<String, String> originalSampleDetailsFieldRelationMap = new HashMap<>();
* originalSampleDetailsTableVo.setFieldRelationMap(originalSampleDetailsFieldRelationMap);
* originalSampleDetailsFieldRelationMap.put("parent_id_", "parent_id_");
* originalSampleDetailsFieldRelationMap.put("sample_num_", "sample_num_");
* originalSampleDetailsFieldRelationMap.put("sample_type_", "sample_type_");
* originalSampleDetailsFieldRelationMap.put("jian_ce_xiang_mu_", "jian_ce_xiang_mu_");
* originalSampleDetailsFieldRelationMap.put("xiang_mu_ming_", "xiang_mu_ming_");
* originalSampleDetailsFieldRelationMap.put("yong_tu_", "yong_tu_");
* originalSampleDetailsFieldRelationMap.put("bao_cun_jie_zhi_", "bao_cun_jie_zhi_");
* originalSampleDetailsFieldRelationMap.put("sample_tube_type_", "sample_tube_type_");
* originalSampleDetailsFieldRelationMap.put("zhi_liang_", "zhi_liang_");
* originalSampleDetailsFieldRelationMap.put("zhi_liang_", "zhi_liang_");
* originalSampleDetailsFieldRelationMap.put("ti_ji_", "ti_ji_");
* originalSampleDetailsFieldRelationMap.put("nong_du_", "nong_du_");
*
* Map<String, Object> originalSampleDetailsFieldParams = new HashMap<>();
* originalSampleDetailsTableVo.setFieldParams(originalSampleDetailsFieldParams);
* originalSampleDetailsFieldParams.put("register_serial_", registerSerial);
* originalSampleDetailsFieldParams.put("zhuang_tai_", "1");
*
* TargetTableVo elememtSpecialTableVo = new TargetTableVo("parent_id_","t_sampleDetails","t_elememtSpecial","id_","jian_ce_xiang_mu_","jian_ce_xiang_mu_","char", "");
* 
* Map<String, String> elememtSpecialFieldRelationMap = new HashMap<>();
* elememtSpecialTableVo.setFieldRelationMap(elememtSpecialFieldRelationMap);
* elememtSpecialFieldRelationMap.put("parent_id_", "parent_id_");
* elememtSpecialFieldRelationMap.put("sample_num_", "sample_num_");
* elememtSpecialFieldRelationMap.put("sample_type_", "sample_type_");
* elememtSpecialFieldRelationMap.put("jian_ce_xiang_mu_", "jian_ce_xiang_mu_");
*
* Map<String, Object> elememtSpecialFieldParams = new HashMap<>();
* elememtSpecialTableVo.setFieldParams(elememtSpecialFieldParams);
* elememtSpecialFieldParams.put("register_serial_", registerSerial);
* elememtSpecialFieldParams.put("zhuang_tai_", "1");
* 
* businessScript.syncDataBySql("t_registrationList", "id_", id, originalSampleDetailsTableVo, elememtSpecialTableVo);
 * </pre>
 *
 * @param sourceTableName    源表名称
 * @param sourceTableIdentifyField    源表标识字段名
 * @param sourceTableIdentifyFieldValue    源表标识字段值
 * @param tableVos     操作表数组
 * TODO 待验证
 */
public List<String> syncDataBySql(String sourceTableName, String sourceTableIdentifyField, String sourceTableIdentifyFieldValue
        , Map<String, List<Object[]>> sqls , TargetTableVo ... tableVos);


/**
 * 根据主从表归档数据
 * <pre>
 * import com.lc.ibps.platform.script.script.vo.TargetTableVo;
* import java.util.HashMap;
* import java.util.Map;
*
* TargetTableVo originalSampleDetailsTableVo = new TargetTableVo("parent_id_","t_sampleDetails","t_originalSampleDetails","id_","shu_liang_","old_sample_num_","count","{{FIELD:sample_num_}}-{{NUM:2:0}}");
*
* Map<String, String> originalSampleDetailsFieldRelationMap = new HashMap<>();
* originalSampleDetailsTableVo.setFieldRelationMap(originalSampleDetailsFieldRelationMap);
* originalSampleDetailsFieldRelationMap.put("parent_id_", "parent_id_");
* originalSampleDetailsFieldRelationMap.put("sample_num_", "sample_num_");
* originalSampleDetailsFieldRelationMap.put("sample_type_", "sample_type_");
* originalSampleDetailsFieldRelationMap.put("jian_ce_xiang_mu_", "jian_ce_xiang_mu_");
* originalSampleDetailsFieldRelationMap.put("xiang_mu_ming_", "xiang_mu_ming_");
* originalSampleDetailsFieldRelationMap.put("yong_tu_", "yong_tu_");
* originalSampleDetailsFieldRelationMap.put("bao_cun_jie_zhi_", "bao_cun_jie_zhi_");
* originalSampleDetailsFieldRelationMap.put("sample_tube_type_", "sample_tube_type_");
* originalSampleDetailsFieldRelationMap.put("zhi_liang_", "zhi_liang_");
* originalSampleDetailsFieldRelationMap.put("zhi_liang_", "zhi_liang_");
* originalSampleDetailsFieldRelationMap.put("ti_ji_", "ti_ji_");
* originalSampleDetailsFieldRelationMap.put("nong_du_", "nong_du_");
*
* Map<String, Object> originalSampleDetailsFieldParams = new HashMap<>();
* originalSampleDetailsTableVo.setFieldParams(originalSampleDetailsFieldParams);
* originalSampleDetailsFieldParams.put("register_serial_", registerSerial);
* originalSampleDetailsFieldParams.put("zhuang_tai_", "1");
*
* TargetTableVo elememtSpecialTableVo = new TargetTableVo("parent_id_","t_sampleDetails","t_elememtSpecial","id_","jian_ce_xiang_mu_","jian_ce_xiang_mu_","char", "");
*
* Map<String, String> elememtSpecialFieldRelationMap = new HashMap<>();
* elememtSpecialTableVo.setFieldRelationMap(elememtSpecialFieldRelationMap);
* elememtSpecialFieldRelationMap.put("parent_id_", "parent_id_");
* elememtSpecialFieldRelationMap.put("sample_num_", "sample_num_");
* elememtSpecialFieldRelationMap.put("sample_type_", "sample_type_");
* elememtSpecialFieldRelationMap.put("jian_ce_xiang_mu_", "jian_ce_xiang_mu_");
*
* Map<String, Object> elememtSpecialFieldParams = new HashMap<>();
* elememtSpecialTableVo.setFieldParams(elememtSpecialFieldParams);
* elememtSpecialFieldParams.put("register_serial_", registerSerial);
* elememtSpecialFieldParams.put("zhuang_tai_", "1");
*
* businessScript.archiveDataBySql(elememtSpecialTableVo);
 * </pre>
 *
 * @param sourceTableName    源表名称
 * @param sourceTableIdentifyField    源表标识字段名
 * @param sourceTableIdentifyFieldValue    源表标识字段值
 * @param tableVos     操作表数组
 */
public void archiveDataBySql(ArchiveTargetTableVo ... tableVos);

/**
 * 根据主从表归档数据
 * <pre>
 * import com.lc.ibps.platform.script.script.vo.TargetTableVo;
* import java.util.HashMap;
* import java.util.Map;
* 
* TargetTableVo originalSampleDetailsTableVo = new TargetTableVo("parent_id_","t_sampleDetails","t_originalSampleDetails","id_","shu_liang_","old_sample_num_","count","{{FIELD:sample_num_}}-{{NUM:2:0}}");
* 
* Map<String, String> originalSampleDetailsFieldRelationMap = new HashMap<>();
* originalSampleDetailsTableVo.setFieldRelationMap(originalSampleDetailsFieldRelationMap);
* originalSampleDetailsFieldRelationMap.put("parent_id_", "parent_id_");
* originalSampleDetailsFieldRelationMap.put("sample_num_", "sample_num_");
* originalSampleDetailsFieldRelationMap.put("sample_type_", "sample_type_");
* originalSampleDetailsFieldRelationMap.put("jian_ce_xiang_mu_", "jian_ce_xiang_mu_");
* originalSampleDetailsFieldRelationMap.put("xiang_mu_ming_", "xiang_mu_ming_");
* originalSampleDetailsFieldRelationMap.put("yong_tu_", "yong_tu_");
* originalSampleDetailsFieldRelationMap.put("bao_cun_jie_zhi_", "bao_cun_jie_zhi_");
* originalSampleDetailsFieldRelationMap.put("sample_tube_type_", "sample_tube_type_");
* originalSampleDetailsFieldRelationMap.put("zhi_liang_", "zhi_liang_");
* originalSampleDetailsFieldRelationMap.put("zhi_liang_", "zhi_liang_");
* originalSampleDetailsFieldRelationMap.put("ti_ji_", "ti_ji_");
* originalSampleDetailsFieldRelationMap.put("nong_du_", "nong_du_");
*
* Map<String, Object> originalSampleDetailsFieldParams = new HashMap<>();
* originalSampleDetailsTableVo.setFieldParams(originalSampleDetailsFieldParams);
* originalSampleDetailsFieldParams.put("register_serial_", registerSerial);
* originalSampleDetailsFieldParams.put("zhuang_tai_", "1");
*
* TargetTableVo elememtSpecialTableVo = new TargetTableVo("parent_id_","t_sampleDetails","t_elememtSpecial","id_","jian_ce_xiang_mu_","jian_ce_xiang_mu_","char", "");
* 
* Map<String, String> elememtSpecialFieldRelationMap = new HashMap<>();
* elememtSpecialTableVo.setFieldRelationMap(elememtSpecialFieldRelationMap);
* elememtSpecialFieldRelationMap.put("parent_id_", "parent_id_");
* elememtSpecialFieldRelationMap.put("sample_num_", "sample_num_");
* elememtSpecialFieldRelationMap.put("sample_type_", "sample_type_");
* elememtSpecialFieldRelationMap.put("jian_ce_xiang_mu_", "jian_ce_xiang_mu_");
*
* Map<String, Object> elememtSpecialFieldParams = new HashMap<>();
* elememtSpecialTableVo.setFieldParams(elememtSpecialFieldParams);
* elememtSpecialFieldParams.put("register_serial_", registerSerial);
* elememtSpecialFieldParams.put("zhuang_tai_", "1");
* 
* businessScript.archiveDataBySql(elememtSpecialTableVo);
 * </pre>
 *
 * @param sourceTableName    源表名称
 * @param sourceTableIdentifyField    源表标识字段名
 * @param sourceTableIdentifyFieldValue    源表标识字段值
 * @param tableVos     操作表数组
 * TODO 待验证
 */
@SuppressWarnings("rawtypes")
public void archiveDataBySql(Map<String, List<Object[]>> sqls, ArchiveTargetTableVo ... tableVos);

/**
 * <pre>
 * Map<String,Object> valMap = new HashMap<String,Object>();
 *    valMap.put("id_",zxddsq.get("id"));
 *     valMap.put("he_tong_bian_hao_",zxddsq.get("heTongBianHao"));
 *    valMap.put("lian_xi_ren_",zxddsq.get("lianXiRen") );
 *    valMap.put("lian_xi_dian_hua_",zxddsq.get("lianXiDianHua"));
 *    scriptImpl.addDataByBusKey("t_yskb",valMap);


 *    import com.lc.ibps.base.core.util.BeanUtils;
 *    import com.lc.ibps.base.core.exception.BaseException;

 *    List<String> queryParams = new ArrayList<>();
 *    queryParams.add("zhuang_tai_");

 *    Map<String, String> whereParams = new HashMap<String,String>();
 *    whereParams.put("id_",businessKey_); 

 *    String status = scriptImpl.queryDataForList("t_yskb",queryParams,whereParams,null,"zhuang_tai_");
 *    boolean isJump = scriptImpl.isValue(status,"1");
 *    return isJump;
 * </pre>
 * 根据查询语句,获取某个字段值
 * @param tableName 表名
 * @param queryParams 查询字段
 * @param whereParams 查询条件
 * @param fileName 获取某个字段值
 * @return
 */
public String getFieldValue(String tableName,List<String> queryParams,Map<String, String> whereParams,String fieldName);

/**
 * 根据查询源目标的统计字段值,更新到目标表字段信息
 * @param pkValue 主键值
 * @param sumTbale 统计表
 * @param queryParams 查询字段
 * @param whereParams 条件字段
 * @param updateTable 更新目标表
 * @param updateMap 对应更新字段值
 * @param updateWhereMap 对应更新条件字段
 */
public void sumNumUpdateBySql(String sumTbale, List<String> queryParams, Map<String, String> whereParams,
        List<String> groupParams, Map<String, String> getFieldMap, String updateTable,
        Map<String, String> updateWhereMap);

/**
 * 根据查询源目标的统计字段值,更新到目标表字段信息
 * @param pkValue 主键值
 * @param sumTbale 统计表
 * @param queryParams 查询字段
 * @param whereParams 条件字段
 * @param updateTable 更新目标表
 * @param updateMap 对应更新字段值
 * @param updateWhereMap 对应更新条件字段
 * TODO 待验证
 */
public void sumNumUpdateBySql(String sumTbale, List<String> queryParams, Map<String, String> whereParams,
        List<String> groupParams, Map<String, String> getFieldMap, String updateTable,
        Map<String, String> updateWhereMap, Map<String, List<Object[]>> sqls);

/**
 * 
 * 根据查询的语句同时存在增、减的数据,进行更新其他表的数据信息
 * @param pkValue 主键
 * @param sourceTable 源头表
 * @param originalTable 原始表
 * @param sourceMap 源头查询字段
 * @param riginalMap 原始表字段
 * @param updateMap 更正表字段
 * @param params 关联查询字段
 */
public void calculationDataBySql(String pkValue, String sourceTable, String sourceIdentifyField,
        String originalTable, Map<String, String> params, Map<String, String> updateParams);

/**
 * 
 * 根据查询的语句同时存在增、减的数据,进行更新其他表的数据信息
 * @param pkValue 主键
 * @param sourceTable 源头表
 * @param originalTable 原始表
 * @param sourceMap 源头查询字段
 * @param riginalMap 原始表字段
 * @param updateMap 更正表字段
 * @param params 关联查询字段
 * TODO 待验证
 */
@SuppressWarnings({ "rawtypes", "unchecked" })
public void calculationDataBySql(String pkValue, String sourceTable, String sourceIdentifyField,
        String originalTable, Map<String, String> params, Map<String, String> updateParams, Map<String, List<Object[]>> sqls);

/**
 * 查询源表信息,插入到目标表
 * @param targetIdentifyField0
 * @param sourceTalbe
 * @param whereFieldMap
 * @param insertTable
 * @param getFieldMap
 * @param fiedValueMap
 */
public void insertHisDataBySql(String targetIdentifyField0, String sourceTalbe, Map<String, String> whereFieldMap, 
        String insertTable, Map<String, String> getFieldMap, Map<String, String> fiedValueMap, 
        String changeValueField, String type, String fangshi, String typeValue, boolean ischange);

/**
 * 查询源表信息,插入到目标表
 * @param targetIdentifyField0
 * @param sourceTalbe
 * @param whereFieldMap
 * @param insertTable
 * @param getFieldMap
 * @param fiedValueMap
 * TODO 待验证
 */
public void insertHisDataBySql(String targetIdentifyField0, String sourceTalbe, Map<String, String> whereFieldMap, 
        String insertTable, Map<String, String> getFieldMap, Map<String, String> fiedValueMap, 
        String changeValueField, String type, String fangshi, String typeValue, boolean ischange, Map<String, List<Object[]>> sqls);

/**
 * 查询源表信息,插入/更新到目标表,传统insert into 表名 ()value方式插入(增加回滚事务)
 * @param sourceTalbe 查询的主表的从表表名
 * @param whereFieldMap 查询从表的条件查询,比如:外键
 * @param insertTable 将数据新增/更新到另个表名
 * @param getFieldMap 新增/更新的字段信息
 * @param fiedValueMap 页面传参值进行更新字段信息
 * @param isAdd  是否新增/更新
 */
public void insertOrUpdateDataBySql(String sourceTalbe, Map<String, String> whereFieldMap, 
        String insertTable, Map<String, String> getFieldMap, Map<String, String> fiedValueMap,  boolean isAdd);

/**
 * 查询源表信息,插入/更新到目标表,传统insert into 表名 ()value方式插入
 * @param sourceTalbe 查询的主表的从表表名
 * @param whereFieldMap 查询从表的条件查询,比如:外键
 * @param insertTable 将数据新增/更新到另个表名
 * @param getFieldMap 新增/更新的字段信息
 * @param fiedValueMap 页面传参值进行更新字段信息
 * @param isAdd  是否新增/更新
 * TODO 待验证
 */
public void insertOrUpdateDataBySql(String sourceTalbe,Map<String, String> whereFieldMap,String insertTable,Map<String, String> getFieldMap,Map<String, String> fiedValueMap,boolean isAdd,Map<String, List<Object[]>> sql);

/**
 * 根据业务外键键和表名获取对应的表信息,再根据主表对应生成的子表流程实例,当子表流程实例全部执行完毕后,返回true
 * @param parentId
 * @param tableName
 * @return
 */
public boolean isNextByNoInstance(String parentId, String currentBizId, String tableName);

/**
 * 根据外键获取相关子表流程实例信息,并子表流程实例全部执行后,执行主流程的待办任务
 * @param parentId
 * @param id
 * @param tableName
 */
public void doNextByNoIntance(String parentId,String id,String tableName);