提交 e6deebc1 编写于 作者: hebao@lab.ibiz5.com's avatar hebao@lab.ibiz5.com

删除不改提交的文件

上级 eb1ce728
package cn.ibizlab.core.rule.mapper;
import cn.ibizlab.core.rule.domain.RuleEngine;
import cn.ibizlab.core.rule.filter.RuleEngineSearchContext;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.*;
import java.io.Serializable;
import java.util.List;
import java.util.Map;
public interface RuleEngineMapper extends BaseMapper<RuleEngine> {
Page<RuleEngine> searchDefault(IPage page, @Param("srf") RuleEngineSearchContext context, @Param("ew") Wrapper<RuleEngine> wrapper);
@Override
RuleEngine selectById(Serializable id);
@Override
int insert(RuleEngine entity);
@Override
int updateById(@Param(Constants.ENTITY) RuleEngine entity);
@Override
int update(@Param(Constants.ENTITY) RuleEngine entity, @Param("ew") Wrapper<RuleEngine> updateWrapper);
@Override
int deleteById(Serializable id);
/**
* 自定义查询SQL
* @param sql
* @return
*/
@Select("${sql}")
List<JSONObject> selectBySQL(@Param("sql") String sql, @Param("et")Map param);
/**
* 自定义更新SQL
* @param sql
* @return
*/
@Update("${sql}")
boolean updateBySQL(@Param("sql") String sql, @Param("et")Map param);
/**
* 自定义插入SQL
* @param sql
* @return
*/
@Insert("${sql}")
boolean insertBySQL(@Param("sql") String sql, @Param("et")Map param);
/**
* 自定义删除SQL
* @param sql
* @return
*/
@Delete("${sql}")
boolean deleteBySQL(@Param("sql") String sql, @Param("et")Map param);
List<RuleEngine> selectByModelId(@Param("id") Serializable id);
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.ibizlab.core.rule.mapper.RuleEngineMapper">
<!--该方法用于重写mybatis中selectById方法,以实现查询逻辑属性-->
<select id="selectById" resultMap="RuleEngineResultMap" databaseId="mysql">
<![CDATA[select t1.* from (SELECT t1.`ENGINEID`, t1.`ENGINENAME`, t1.`EXECSTATE`, t1.`EXTPARAMS`, t1.`LASTRUNTIME`, t1.`MODELID`, t1.`MODELNAME`, t1.`PROCESSED`, t1.`RULEGROUP`, t11.`SYSTEMID`, t1.`TOTAL` FROM `IBZRULEENGINE` t1 LEFT JOIN `IBZMODEL` t11 ON t1.`MODELID` = t11.`MODELID` ) t1 where engineid=#{id}]]>
</select>
<select id="selectById" resultMap="RuleEngineResultMap" databaseId="oracle">
<![CDATA[select t1.* from (SELECT t1.ENGINEID, t1.ENGINENAME, t1.EXECSTATE, t1.EXTPARAMS, t1.LASTRUNTIME, t1.MODELID, t1.MODELNAME, t1.PROCESSED, t1.RULEGROUP, t11.SYSTEMID, t1.TOTAL FROM IBZRULEENGINE t1 LEFT JOIN IBZMODEL t11 ON t1.MODELID = t11.MODELID ) t1 where engineid=#{id}]]>
</select>
<select id="selectById" resultMap="RuleEngineResultMap" databaseId="postgresql">
<![CDATA[select t1.* from (SELECT t1.ENGINEID, t1.ENGINENAME, t1.EXECSTATE, t1.EXTPARAMS, t1.LASTRUNTIME, t1.MODELID, t1.MODELNAME, t1.PROCESSED, t1.RULEGROUP, t11.SYSTEMID, t1.TOTAL FROM IBZRULEENGINE t1 LEFT JOIN IBZMODEL t11 ON t1.MODELID = t11.MODELID ) t1 where engineid=#{id}]]>
</select>
<!--通过mybatis将查询结果注入到entity中,通过配置autoMapping="true"由mybatis自动处理映射关系 -->
<resultMap id="RuleEngineResultMap" type="cn.ibizlab.core.rule.domain.RuleEngine" autoMapping="true">
<id property="engineId" column="engineid" /><!--主键字段映射-->
<result property="group" column="rulegroup" />
<result property="modelId" column="modelid" />
<result property="state" column="execstate" />
<!--通过mybatis自动注入关系属性[主实体],fetchType="lazy"为懒加载配置 -->
<association property="model" javaType="cn.ibizlab.core.lite.domain.MetaModel" column="modelid" select="cn.ibizlab.core.lite.mapper.MetaModelMapper.selectById" fetchType="lazy"></association>
</resultMap>
<!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_RU_ENGINE_META_MODEL_MODELID] -->
<select id="selectByModelId" resultMap="RuleEngineResultMap">
select t1.* from (
<include refid="Default" />
) t1
where modelid=#{id}
</select>
<!--数据集合[Default]-->
<select id="searchDefault" parameterType="cn.ibizlab.core.rule.filter.RuleEngineSearchContext" resultMap="RuleEngineResultMap">
select t1.* from (
<include refid="Default" />
)t1
<where><if test="ew!=null and ew.sqlSegment!=null and !ew.emptyOfWhere">${ew.sqlSegment}</if></where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">${ew.sqlSegment}</if>
</select>
<!--数据查询[Default]-->
<sql id="Default" databaseId="mysql">
<![CDATA[ SELECT t1.`ENGINEID`, t1.`ENGINENAME`, t1.`EXECSTATE`, t1.`LASTRUNTIME`, t1.`MODELID`, t1.`MODELNAME`, t1.`PROCESSED`, t1.`RULEGROUP`, t11.`SYSTEMID`, t1.`TOTAL` FROM `IBZRULEENGINE` t1 LEFT JOIN `IBZMODEL` t11 ON t1.`MODELID` = t11.`MODELID`
]]>
</sql>
<!--数据查询[Default]-->
<sql id="Default" databaseId="oracle">
<![CDATA[ SELECT t1.ENGINEID, t1.ENGINENAME, t1.EXECSTATE, t1.LASTRUNTIME, t1.MODELID, t1.MODELNAME, t1.PROCESSED, t1.RULEGROUP, t11.SYSTEMID, t1.TOTAL FROM IBZRULEENGINE t1 LEFT JOIN IBZMODEL t11 ON t1.MODELID = t11.MODELID
]]>
</sql>
<!--数据查询[Default]-->
<sql id="Default" databaseId="postgresql">
<![CDATA[ SELECT t1.ENGINEID, t1.ENGINENAME, t1.EXECSTATE, t1.LASTRUNTIME, t1.MODELID, t1.MODELNAME, t1.PROCESSED, t1.RULEGROUP, t11.SYSTEMID, t1.TOTAL FROM IBZRULEENGINE t1 LEFT JOIN IBZMODEL t11 ON t1.MODELID = t11.MODELID
]]>
</sql>
<!--数据查询[View]-->
<sql id="View" databaseId="mysql">
<![CDATA[ SELECT t1.`ENGINEID`, t1.`ENGINENAME`, t1.`EXECSTATE`, t1.`EXTPARAMS`, t1.`LASTRUNTIME`, t1.`MODELID`, t1.`MODELNAME`, t1.`PROCESSED`, t1.`RULEGROUP`, t11.`SYSTEMID`, t1.`TOTAL` FROM `IBZRULEENGINE` t1 LEFT JOIN `IBZMODEL` t11 ON t1.`MODELID` = t11.`MODELID`
]]>
</sql>
<!--数据查询[View]-->
<sql id="View" databaseId="oracle">
<![CDATA[ SELECT t1.ENGINEID, t1.ENGINENAME, t1.EXECSTATE, t1.EXTPARAMS, t1.LASTRUNTIME, t1.MODELID, t1.MODELNAME, t1.PROCESSED, t1.RULEGROUP, t11.SYSTEMID, t1.TOTAL FROM IBZRULEENGINE t1 LEFT JOIN IBZMODEL t11 ON t1.MODELID = t11.MODELID
]]>
</sql>
<!--数据查询[View]-->
<sql id="View" databaseId="postgresql">
<![CDATA[ SELECT t1.ENGINEID, t1.ENGINENAME, t1.EXECSTATE, t1.EXTPARAMS, t1.LASTRUNTIME, t1.MODELID, t1.MODELNAME, t1.PROCESSED, t1.RULEGROUP, t11.SYSTEMID, t1.TOTAL FROM IBZRULEENGINE t1 LEFT JOIN IBZMODEL t11 ON t1.MODELID = t11.MODELID
]]>
</sql>
</mapper>
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册