|
@@ -49,7 +49,23 @@ public class FormulaClientImpl implements FormulaClient {
|
|
return "表id有误";
|
|
return "表id有误";
|
|
}
|
|
}
|
|
Map<String, String> keysMap = FormulaUtils.getElementCell(wtc.getHtmlUrl());
|
|
Map<String, String> keysMap = FormulaUtils.getElementCell(wtc.getHtmlUrl());
|
|
- Long id = this.jdbcTemplate.queryForObject("select d.formula_id from m_wbs_tree_contract a join m_table_info b on a.init_table_name=b.tab_en_name join m_wbs_form_element c on c.f_id=b.id join m_element_formula_mapping d on c.id=d.element_id where a.p_key_id=" + pkId + " and c.e_key='" + key + "' ORDER BY d.scope desc limit 1", Long.class);
|
|
|
|
|
|
+ String sql="SELECT d.formula_id \n" +
|
|
|
|
+ "FROM m_wbs_tree_contract a \n" +
|
|
|
|
+ "JOIN m_table_info b ON a.init_table_name = b.tab_en_name \n" +
|
|
|
|
+ "JOIN m_wbs_form_element c ON c.f_id = b.id \n" +
|
|
|
|
+ "JOIN m_element_formula_mapping d ON c.id = d.element_id \n" +
|
|
|
|
+ "WHERE a.p_key_id = "+pkId+"\n" +
|
|
|
|
+ " AND c.e_key = '"+key+"' \n" +
|
|
|
|
+ " AND (d.project_id = "+wtc.getProjectId()+" OR (d.project_id IS NULL))\n" +
|
|
|
|
+ "ORDER BY \n" +
|
|
|
|
+ " CASE \n" +
|
|
|
|
+ " WHEN d.project_id = "+wtc.getProjectId()+" THEN 0 \n" +
|
|
|
|
+ " ELSE 1 \n" +
|
|
|
|
+ " END,\n" +
|
|
|
|
+ " d.scope DESC \n" +
|
|
|
|
+ "LIMIT 1";
|
|
|
|
+ // "select d.formula_id from m_wbs_tree_contract a join m_table_info b on a.init_table_name=b.tab_en_name join m_wbs_form_element c on c.f_id=b.id join m_element_formula_mapping d on c.id=d.element_id where a.p_key_id=" + pkId + " and c.e_key='" + key + "' ORDER BY d.scope desc limit 1"
|
|
|
|
+ Long id = this.jdbcTemplate.queryForObject(sql, Long.class);
|
|
if (Func.isNotEmpty(id)) {
|
|
if (Func.isNotEmpty(id)) {
|
|
Formula formula = this.service.getById(id);
|
|
Formula formula = this.service.getById(id);
|
|
if (Func.isNotEmpty(formula)) {
|
|
if (Func.isNotEmpty(formula)) {
|