自定义报表 代码优化

软适配 项目初始化增删改
yun-zuoyi
wei.peng 6 years ago
parent dedc7b45fe
commit ef6d24682e

@ -13,5 +13,11 @@
<artifactId>i3plus-pojo-softswitch</artifactId>
<packaging>jar</packaging>
<dependencies>
<dependency>
<groupId>i3plus.pojo</groupId>
<artifactId>i3plus-pojo-base</artifactId>
</dependency>
</dependencies>
</project>

@ -0,0 +1,39 @@
package cn.estsh.i3plus.pojo.softswitch.bean;
import cn.estsh.i3plus.pojo.base.bean.BaseBean;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiParam;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
/**
* @Description :
* @Reference :
* @Author : Adair Peng
* @CreateDate : 2019-02-28 15:48
* @Modify:
**/
@Data
@Entity
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode(callSuper = true)
@Table(name="TEST_DATA_BASE")
@Api(value="测试数据 DataBase",description = "数据库操作测试")
public class TestDataBase extends BaseBean {
@Column(name="NAME")
@ApiParam(value ="名称" )
private String name;
@Column(name="TYPE")
@ApiParam(value ="测试类型" )
private Integer type;
}

@ -0,0 +1,14 @@
package cn.estsh.i3plus.pojo.softswitch.repository;
import cn.estsh.i3plus.pojo.base.jpa.dao.BaseRepository;
import cn.estsh.i3plus.pojo.softswitch.bean.TestDataBase;
/**
* @Description :
* @Reference :
* @Author : Adair Peng
* @CreateDate : 2019-02-28 15:48
* @Modify:
**/
public interface TestDataBaseRepository extends BaseRepository<TestDataBase,Long> {
}

@ -0,0 +1,44 @@
package cn.estsh.i3plus.pojo.softswitch.sqlpack;
import cn.estsh.i3plus.pojo.base.tool.HqlPack;
import cn.estsh.i3plus.pojo.softswitch.bean.TestDataBase;
import org.apache.commons.lang3.StringUtils;
/**
* @Description :
* @Reference :
* @Author : Adair Peng
* @CreateDate : 2019-02-28 16:05
* @Modify:
**/
public class SoftswitchHqlPack {
/**
* In
* @param columnName
* @return
*/
public static String packHqlIds(String columnName,String[] params){
StringBuffer result = new StringBuffer();
// 参数数组 [1,2,3] -> "1,2,3"
HqlPack.getInPack(String.join(",",params),columnName,result);
return result.toString();
}
/**
*
* @param testDataBase
* @return
*/
public static String packHqlTestDataBase(TestDataBase testDataBase){
StringBuffer result = new StringBuffer();
// 查询参数封装
HqlPack.getStringLikerPack(testDataBase.getName(),"name",result);
return result.toString();
}
}
Loading…
Cancel
Save