Commit 66a27b62 by manxiaoqiang

reged

parent 5baa703d
package com.reyun.model;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
import java.util.Date;
/**
* Created by admin on 2017/3/3.
*/
@Entity
public class IONotice {
private Long id;
@NotNull
private String title;
@NotNull
private String content;
private Boolean isdeploy;
private Date deployDate;
private Date createDate;
private Date endDate;
private String createUser;
private Date modifyDate;
private String modifyUser;
private Boolean is_top;
private Long deployAccountId;
private String deployUserName;
private String deployAccountEmail;
private Long ioAccount;
private Long trackAccount;
private String trackAccountList;
private String ioAccountList;
private Boolean trackAll;
private Boolean ioAll;
private String accountType;
private Boolean release;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public Boolean getIsdeploy() {
return isdeploy;
}
public void setIsdeploy(Boolean isdeploy) {
this.isdeploy = isdeploy;
}
public Date getDeployDate() {
return deployDate;
}
public void setDeployDate(Date deployDate) {
this.deployDate = deployDate;
}
public Date getCreateDate() {
return createDate;
}
public void setCreateDate(Date createDate) {
this.createDate = createDate;
}
public Date getEndDate() {
return endDate;
}
public void setEndDate(Date endDate) {
this.endDate = endDate;
}
public String getCreateUser() {
return createUser;
}
public void setCreateUser(String createUser) {
this.createUser = createUser;
}
public Date getModifyDate() {
return modifyDate;
}
public void setModifyDate(Date modifyDate) {
this.modifyDate = modifyDate;
}
public String getModifyUser() {
return modifyUser;
}
public void setModifyUser(String modifyUser) {
this.modifyUser = modifyUser;
}
public Boolean getIs_top() {
return is_top;
}
public void setIs_top(Boolean is_top) {
this.is_top = is_top;
}
public Long getDeployAccountId() {
return deployAccountId;
}
public void setDeployAccountId(Long deployAccountId) {
this.deployAccountId = deployAccountId;
}
public String getDeployUserName() {
return deployUserName;
}
public void setDeployUserName(String deployUserName) {
this.deployUserName = deployUserName;
}
public String getDeployAccountEmail() {
return deployAccountEmail;
}
public void setDeployAccountEmail(String deployAccountEmail) {
this.deployAccountEmail = deployAccountEmail;
}
public Long getIoAccount() {
return ioAccount;
}
public void setIoAccount(Long ioAccount) {
this.ioAccount = ioAccount;
}
@Transient
public Long getTrackAccount() {
return trackAccount;
}
public void setTrackAccount(Long trackAccount) {
this.trackAccount = trackAccount;
}
public String getTrackAccountList() {
return trackAccountList;
}
public void setTrackAccountList(String trackAccountList) {
this.trackAccountList = trackAccountList;
}
public String getIoAccountList() {
return ioAccountList;
}
public void setIoAccountList(String ioAccountList) {
this.ioAccountList = ioAccountList;
}
public String getAccountType() {
return accountType;
}
public void setAccountType(String accountType) {
this.accountType = accountType;
}
public Boolean getTrackAll() {
return trackAll;
}
public void setTrackAll(Boolean trackAll) {
this.trackAll = trackAll;
}
public Boolean getIoAll() {
return ioAll;
}
public void setIoAll(Boolean ioAll) {
this.ioAll = ioAll;
}
@Transient
public Boolean getRelease() {
return release;
}
public void setRelease(Boolean release) {
this.release = release;
}
}
package com.reyun.repository; package com.reyun.repository;
import com.reyun.model.Notice; import com.reyun.model.IONotice;
import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query; import org.springframework.data.jpa.repository.Query;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.util.Date;
import java.util.List; import java.util.List;
/** /**
* Created by sunhao on 17/3/1. * Created by sunhao on 17/3/1.
*/ */
@Transactional @Transactional
public interface NoticeRepository extends JpaRepository<Notice, Long> { public interface NoticeRepository extends JpaRepository<IONotice, Long> {
@Query(value = "select * from notice n where n.isdeploy is true and (io_account = ?1 or io_account = -1)", nativeQuery = true) @Query(value = "select * from notice n where n.isdeploy is true and (io_account = ?1 or io_account = -1) order by id desc", nativeQuery = true)
List<Notice> listRecentDeployNotice(Long account); List<IONotice> listRecentDeployNotice(Long account);
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment