提交 37c0f655 编写于 作者: ibizdev's avatar ibizdev

xignzi006 发布系统代码

上级 8babb97b
......@@ -79,6 +79,22 @@ public class Ir_model_fields extends EntityMP implements Serializable {
@JSONField(name = "field_description")
@JsonProperty("field_description")
private String fieldDescription;
/**
* ID
*/
@DEField(name = "model_id")
@TableField(value = "model_id")
@JSONField(name = "model_id")
@JsonProperty("model_id")
private Long modelId;
/**
*
*/
@JsonIgnore
@JSONField(serialize = false)
@TableField(exist = false)
private cn.ibizlab.businesscentral.core.odoo_ir.domain.Ir_model odooModel;
......@@ -114,6 +130,14 @@ public class Ir_model_fields extends EntityMP implements Serializable {
this.modify("field_description",fieldDescription);
}
/**
* 设置 [ID]
*/
public void setModelId(Long modelId){
this.modelId = modelId ;
this.modify("model_id",modelId);
}
@Override
public Serializable getDefaultKey(boolean gen) {
......
......@@ -34,6 +34,20 @@ public class Ir_model_fieldsSearchContext extends QueryWrapperContext<Ir_model_f
this.getSearchCond().like("name", n_name_like);
}
}
private String n_model_eq;//[模型]
public void setN_model_eq(String n_model_eq) {
this.n_model_eq = n_model_eq;
if(!ObjectUtils.isEmpty(this.n_model_eq)){
this.getSearchCond().eq("model", n_model_eq);
}
}
private Long n_model_id_eq;//[ID]
public void setN_model_id_eq(Long n_model_id_eq) {
this.n_model_id_eq = n_model_id_eq;
if(!ObjectUtils.isEmpty(this.n_model_id_eq)){
this.getSearchCond().eq("model_id", n_model_id_eq);
}
}
/**
* 启用快速搜索
......
......@@ -62,4 +62,6 @@ public interface Ir_model_fieldsMapper extends BaseMapper<Ir_model_fields>{
@Delete("${sql}")
boolean deleteBySQL(@Param("sql") String sql, @Param("et")Map param);
List<Ir_model_fields> selectByModelId(@Param("id") Serializable id) ;
}
......@@ -38,6 +38,8 @@ public interface IIr_model_fieldsService extends IService<Ir_model_fields>{
boolean save(Ir_model_fields et) ;
void saveBatch(List<Ir_model_fields> list) ;
Page<Ir_model_fields> searchDefault(Ir_model_fieldsSearchContext context) ;
List<Ir_model_fields> selectByModelId(Long id) ;
void removeByModelId(Long id) ;
/**
*自定义查询SQL
* @param sql select * from table where id =#{et.param}
......
......@@ -48,6 +48,9 @@ import org.springframework.util.StringUtils;
@Service("Ir_modelServiceImpl")
public class Ir_modelServiceImpl extends ServiceImpl<Ir_modelMapper, Ir_model> implements IIr_modelService {
@Autowired
@Lazy
protected cn.ibizlab.businesscentral.core.odoo_ir.service.IIr_model_fieldsService irModelFieldsService;
protected int batchSize = 500;
......
......@@ -48,6 +48,9 @@ import org.springframework.util.StringUtils;
@Service("Ir_model_fieldsServiceImpl")
public class Ir_model_fieldsServiceImpl extends ServiceImpl<Ir_model_fieldsMapper, Ir_model_fields> implements IIr_model_fieldsService {
@Autowired
@Lazy
protected cn.ibizlab.businesscentral.core.odoo_ir.service.IIr_modelService irModelService;
protected int batchSize = 500;
......@@ -148,6 +151,16 @@ public class Ir_model_fieldsServiceImpl extends ServiceImpl<Ir_model_fieldsMappe
}
@Override
public List<Ir_model_fields> selectByModelId(Long id) {
return baseMapper.selectByModelId(id);
}
@Override
public void removeByModelId(Long id) {
this.remove(new QueryWrapper<Ir_model_fields>().eq("model_id",id));
}
/**
* 查询集合 数据集
......
......@@ -5,17 +5,27 @@
<!--该方法用于重写mybatis中selectById方法,以实现查询逻辑属性-->
<select id="selectById" resultMap="Ir_model_fieldsResultMap" databaseId="postgresql">
<![CDATA[select t1.* from (SELECT t1.FIELD_DESCRIPTION, t1.ID, t1.MODEL, t1.NAME, t1.TRACKING FROM IR_MODEL_FIELDS t1 ) t1 where id=#{id}]]>
<![CDATA[select t1.* from (SELECT t1.FIELD_DESCRIPTION, t1.ID, t1.MODEL, t1.MODEL_ID, t1.NAME, t1.TRACKING FROM IR_MODEL_FIELDS t1 ) t1 where id=#{id}]]>
</select>
<!--通过mybatis将查询结果注入到entity中,通过配置autoMapping="true"由mybatis自动处理映射关系 -->
<resultMap id="Ir_model_fieldsResultMap" type="cn.ibizlab.businesscentral.core.odoo_ir.domain.Ir_model_fields" autoMapping="true">
<id property="id" column="id" /><!--主键字段映射-->
<result property="fieldDescription" column="field_description" />
<result property="modelId" column="model_id" />
<!--通过mybatis自动注入关系属性[主实体],fetchType="lazy"为懒加载配置 -->
<association property="odooModel" javaType="cn.ibizlab.businesscentral.core.odoo_ir.domain.Ir_model" column="model_id" select="cn.ibizlab.businesscentral.core.odoo_ir.mapper.Ir_modelMapper.selectById" fetchType="lazy"></association>
</resultMap>
<!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_IR_MODEL_FIELDS_IR_MODEL_MODEL_ID] -->
<select id="selectByModelId" resultMap="Ir_model_fieldsResultMap">
select t1.* from (
<include refid="Default" />
) t1
where model_id=#{id}
</select>
<!--数据集合[Default]-->
<select id="searchDefault" parameterType="cn.ibizlab.businesscentral.core.odoo_ir.filter.Ir_model_fieldsSearchContext" resultMap="Ir_model_fieldsResultMap">
......@@ -28,12 +38,12 @@
<!--数据查询[Default]-->
<sql id="Default" databaseId="postgresql">
<![CDATA[ SELECT t1.FIELD_DESCRIPTION, t1.ID, t1.MODEL, t1.NAME, t1.TRACKING FROM IR_MODEL_FIELDS t1
<![CDATA[ SELECT t1.FIELD_DESCRIPTION, t1.ID, t1.MODEL, t1.MODEL_ID, t1.NAME, t1.TRACKING FROM IR_MODEL_FIELDS t1
]]>
</sql>
<!--数据查询[View]-->
<sql id="View" databaseId="postgresql">
<![CDATA[ SELECT t1.FIELD_DESCRIPTION, t1.ID, t1.MODEL, t1.NAME, t1.TRACKING FROM IR_MODEL_FIELDS t1
<![CDATA[ SELECT t1.FIELD_DESCRIPTION, t1.ID, t1.MODEL, t1.MODEL_ID, t1.NAME, t1.TRACKING FROM IR_MODEL_FIELDS t1
]]>
</sql>
</mapper>
......
......@@ -71639,6 +71639,12 @@
}
],
"subEntitys":[
{"name":"DER1N_IR_MODEL_FIELDS_IR_MODEL_MODEL_ID",
"relation_type":"DER1N",
"code_name":"Odoo_model",
"entity_name":"IR_MODEL_FIELDS",
"ref_entity_name":"IR_MODEL"
}
],
"parentEntitys":[
]
......@@ -71715,11 +71721,34 @@
"data_length":100,
"key_field":0,
"major_field":0
},
{
"fieldname":"MODEL_ID" ,
"codename":"Model_id",
"field_logic_name":"ID",
"entity_name":"Ir_model_fields",
"ref_de":"IR_MODEL",
"ref_field_name":"ID",
"relation_name":"DER1N_IR_MODEL_FIELDS_IR_MODEL_MODEL_ID",
"relation_codename":"Odoo_model",
"field_type":"PICKUP",
"nullable":1,
"physical_field":1,
"data_type":"BIGINT",
"data_length":20,
"key_field":0,
"major_field":0
}
],
"subEntitys":[
],
"parentEntitys":[
{"name":"DER1N_IR_MODEL_FIELDS_IR_MODEL_MODEL_ID",
"relation_type":"DER1N",
"code_name":"Odoo_model",
"entity_name":"IR_MODEL_FIELDS",
"ref_entity_name":"IR_MODEL"
}
]
}
,
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册