Merge remote-tracking branch 'remotes/origin/dev' into test
commit
adfe3cb2e6
@ -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…
Reference in New Issue