Эх сурвалжийг харах

git-svn-id: https://192.168.57.71/svn/hbghj@122 201dd7a2-ec1b-f84b-8b06-88221118ff88

ld_liufl 8 жил өмнө
parent
commit
e8a904bf85

+ 21 - 0
gkaq/yjpt-java/trunk/java_src/com/jtgh/cjhs/dao/DtywCbsbDao.java

@@ -0,0 +1,21 @@
+package com.jtgh.cjhs.dao;
+
+import java.util.List;
+
+import org.springframework.data.jpa.repository.Query;
+
+import com.jtgh.cjhs.dao.common.CjhsRepository;
+import com.jtgh.cjhs.entity.DtywCbsbEntity;
+
+/**
+ *长江海事DAO
+ * 
+ * @author 刘福亮
+ * 
+ */
+public interface DtywCbsbDao extends
+		CjhsRepository<DtywCbsbEntity, String> {
+
+	@Query(value = " SELECT * FROM (SELECT * FROM DTYW_CBSB WHERE ZWCM=?1 ORDER BY MRUT DESC)WHERE  ROWNUM<2   ", nativeQuery = true)
+	public List<DtywCbsbEntity> findByZwcm(String zwcm);
+}

+ 1 - 3
gkaq/yjpt-java/trunk/java_src/com/jtgh/cjhs/dao/common/CjhsCustomRepository.java

@@ -18,11 +18,9 @@ import org.springframework.data.jpa.repository.support.JpaEntityInformation;
 import org.springframework.data.jpa.repository.support.SimpleJpaRepository;
 import org.springframework.data.repository.NoRepositoryBean;
 
-import com.jtgh.cjhs.entity.CjhsBaseEntity;
-
 @NoRepositoryBean
 @SuppressWarnings("unchecked")
-public class CjhsCustomRepository<T  extends CjhsBaseEntity, ID extends Serializable>
+public class CjhsCustomRepository<T  , ID extends Serializable>
 		extends SimpleJpaRepository<T, ID> implements CjhsRepository<T, ID> {
 	@SuppressWarnings("unused")
 	private final EntityManager entityManager;

+ 1 - 3
gkaq/yjpt-java/trunk/java_src/com/jtgh/cjhs/dao/common/CjhsRepository.java

@@ -5,8 +5,6 @@ import java.io.Serializable;
 import org.springframework.data.jpa.repository.JpaRepository;
 import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
 
-import com.jtgh.cjhs.entity.CjhsBaseEntity;
-
 /**
  * Dao层共通基类<br>
  * <p>
@@ -22,6 +20,6 @@ import com.jtgh.cjhs.entity.CjhsBaseEntity;
  *            Entity对象的主键类型,一般是{@link Long}
  * @author 刘福亮
  */
-public interface CjhsRepository<T extends CjhsBaseEntity , ID extends Serializable>
+public interface CjhsRepository<T  , ID extends Serializable>
 		extends JpaRepository<T, ID>, JpaSpecificationExecutor<T> {
 }

+ 1 - 5
gkaq/yjpt-java/trunk/java_src/com/jtgh/cjhs/entity/DtxtBwEntity.java

@@ -11,12 +11,8 @@ import javax.persistence.Table;
  */
 @Entity
 @Table(name = "DTXT_BW")
-public class DtxtBwEntity extends CjhsBaseEntity {
+public class DtxtBwEntity  {
 
-	/**
-	 * 
-	 */
-	private static final long serialVersionUID = 7334595383877891661L;
 
 	//泊位代码
 	private String bwdm;

+ 1 - 7
gkaq/yjpt-java/trunk/java_src/com/jtgh/cjhs/entity/DtxtSjhsjgEntity.java

@@ -3,7 +3,6 @@ package com.jtgh.cjhs.entity;
 import java.util.Date;
 
 import javax.persistence.Entity;
-import javax.persistence.Id;
 import javax.persistence.Table;
 
 /**
@@ -13,12 +12,8 @@ import javax.persistence.Table;
  */
 @Entity
 @Table(name = "DTXT_SJHSJG")
-public class DtxtSjhsjgEntity extends CjhsBaseEntity {
+public class DtxtSjhsjgEntity  {
 
-	/**
-	 * 
-	 */
-	private static final long serialVersionUID = -6603097136757104202L;
 
 	//省级机构代码
 	private String sjjgdm;	
@@ -33,7 +28,6 @@ public class DtxtSjhsjgEntity extends CjhsBaseEntity {
 	//更新时间
 	private Date mrut;
 	
-	@Id
 	public String getSjjgdm() {
 		return sjjgdm;
 	}

+ 2 - 7
gkaq/yjpt-java/trunk/java_src/com/jtgh/cjhs/entity/DtxtXjhsjgEntity.java

@@ -1,7 +1,6 @@
 package com.jtgh.cjhs.entity;
 
 import javax.persistence.Entity;
-import javax.persistence.Id;
 import javax.persistence.Table;
 
 /**
@@ -11,12 +10,8 @@ import javax.persistence.Table;
  */
 @Entity
 @Table(name = "DTXT_XJHSJG")
-public class DtxtXjhsjgEntity extends CjhsBaseEntity {
+public class DtxtXjhsjgEntity {
 
-	/**
-	 * 
-	 */
-	private static final long serialVersionUID = 4964897241046444685L;
 	//登录机构代码
 	private String dljgdm;
 	//机构代码 
@@ -31,7 +26,7 @@ public class DtxtXjhsjgEntity extends CjhsBaseEntity {
 	public void setDljgdm(String dljgdm) {
 		this.dljgdm = dljgdm;
 	}
-	@Id
+
 	public String getJgdm() {
 		return jgdm;
 	}

+ 27 - 6
gkaq/yjpt-java/trunk/java_src/com/jtgh/cjhs/entity/DtywCbsbEntity.java

@@ -12,13 +12,9 @@ import javax.persistence.Table;
  */
 @Entity
 @Table(name = "DTYW_CBSB")
-public class DtywCbsbEntity extends CjhsBaseEntity {
+public class DtywCbsbEntity {
 
-	/**
-	 * 
-	 */
-	private static final long serialVersionUID = 8334216326842548765L;
-	//申报单 编号
+	//申报单编号
 	private  String sbdbh;
 	//申报单类别
 	private  String sbdlb;
@@ -48,6 +44,30 @@ public class DtywCbsbEntity extends CjhsBaseEntity {
 	private  String bwdm;
 	//到港时间
 	private  Date dgsj;
+	//航次
+	private String hc;
+	//内外贸标志
+	private String nwmbz;
+	//进出港标志
+	private String jcgbz;
+	public String getHc() {
+		return hc;
+	}
+	public void setHc(String hc) {
+		this.hc = hc;
+	}
+	public String getNwmbz() {
+		return nwmbz;
+	}
+	public void setNwmbz(String nwmbz) {
+		this.nwmbz = nwmbz;
+	}
+	public String getJcgbz() {
+		return jcgbz;
+	}
+	public void setJcgbz(String jcgbz) {
+		this.jcgbz = jcgbz;
+	}
 	//开始作业时间
 	private  Date kszysj;
 	//结束作业时间
@@ -64,6 +84,7 @@ public class DtywCbsbEntity extends CjhsBaseEntity {
 	private  Date shrq;
 	//流转标志
 	private  String lzbz;
+	
 	@Id
 	public String getSbdbh() {
 		return sbdbh;

+ 17 - 15
gkaq/yjpt-java/trunk/java_src/com/jtgh/cjhs/entity/DtywCbsbgtHwEntity.java

@@ -1,7 +1,6 @@
 package com.jtgh.cjhs.entity;
 
 import javax.persistence.Entity;
-import javax.persistence.Id;
 import javax.persistence.Table;
 /**
  * 船舶申报固体货物
@@ -10,12 +9,8 @@ import javax.persistence.Table;
  */
 @Entity
 @Table(name = "DTYW_CBSBGT_HW")
-public class DtywCbsbgtHwEntity extends CjhsBaseEntity {
+public class DtywCbsbgtHwEntity {
 
-	/**
-	 * 
-	 */
-	private static final long serialVersionUID = -6883194039824158796L;
 	//申报单编号
 	private  String sbdbh;
 	//货物类型
@@ -28,13 +23,10 @@ public class DtywCbsbgtHwEntity extends CjhsBaseEntity {
 	private  String wxlb;
 	//总重量
 	private  String zzl;
-	//卸货港中文名称
-	private  String xhgzwmc;
 	//流转标志
 	private  String lzbz;
 	//危险货物标志
 	private  String wxhwbz;
-	@Id
 	public String getSbdbh() {
 		return sbdbh;
 	}
@@ -65,12 +57,6 @@ public class DtywCbsbgtHwEntity extends CjhsBaseEntity {
 	public void setWxlb(String wxlb) {
 		this.wxlb = wxlb;
 	}
-	public String getXhgzwmc() {
-		return xhgzwmc;
-	}
-	public void setXhgzwmc(String xhgzwmc) {
-		this.xhgzwmc = xhgzwmc;
-	}
 	public String getLzbz() {
 		return lzbz;
 	}
@@ -90,4 +76,20 @@ public class DtywCbsbgtHwEntity extends CjhsBaseEntity {
 		this.zzl = zzl;
 	}
 	
+	private Long  bsxh;
+	
+	private Long xh;
+	
+	public Long getBsxh() {
+		return bsxh;
+	}
+	public void setBsxh(Long bsxh) {
+		this.bsxh = bsxh;
+	}
+	public Long getXh() {
+		return xh;
+	}
+	public void setXh(Long xh) {
+		this.xh = xh;
+	}
 }

+ 18 - 13
gkaq/yjpt-java/trunk/java_src/com/jtgh/cjhs/entity/DtywCbsbszHwEntity.java

@@ -12,12 +12,8 @@ import javax.persistence.Table;
  */
 @Entity
 @Table(name = "DTYW_CBSBSZ_HW")
-public class DtywCbsbszHwEntity extends CjhsBaseEntity {
+public class DtywCbsbszHwEntity  {
 
-	/**
-	 * 
-	 */
-	private static final long serialVersionUID = -6710618277902814893L;
 	// 申报单编号
 	private String sbdbh;
 	// 货物类型
@@ -30,8 +26,6 @@ public class DtywCbsbszHwEntity extends CjhsBaseEntity {
 	private String wxlb;
 	// 总重量
 	private Double zzl;
-	// 卸货港中文名称
-	private String xhgzwmc;
 	// 流转标志
 	private String lzbz;
 	// 危险货物标志
@@ -73,12 +67,6 @@ public class DtywCbsbszHwEntity extends CjhsBaseEntity {
 	public void setZzl(Double zzl) {
 		this.zzl = zzl;
 	}
-	public String getXhgzwmc() {
-		return xhgzwmc;
-	}
-	public void setXhgzwmc(String xhgzwmc) {
-		this.xhgzwmc = xhgzwmc;
-	}
 	public String getLzbz() {
 		return lzbz;
 	}
@@ -91,4 +79,21 @@ public class DtywCbsbszHwEntity extends CjhsBaseEntity {
 	public void setWxhwbz(String wxhwbz) {
 		this.wxhwbz = wxhwbz;
 	}
+	
+	private Long  bsxh;
+	
+	private Long xh;
+	
+	public Long getBsxh() {
+		return bsxh;
+	}
+	public void setBsxh(Long bsxh) {
+		this.bsxh = bsxh;
+	}
+	public Long getXh() {
+		return xh;
+	}
+	public void setXh(Long xh) {
+		this.xh = xh;
+	}
 }

+ 19 - 7
gkaq/yjpt-java/trunk/java_src/com/jtgh/cjhs/entity/DtywCbsbytHwEntity.java

@@ -1,7 +1,6 @@
 package com.jtgh.cjhs.entity;
 
 import javax.persistence.Entity;
-import javax.persistence.Id;
 import javax.persistence.Table;
 /**
  * 船舶申报液体货物
@@ -10,12 +9,8 @@ import javax.persistence.Table;
  */
 @Entity
 @Table(name = "DTYW_CBSBYT_HW")
-public class DtywCbsbytHwEntity extends CjhsBaseEntity {
+public class DtywCbsbytHwEntity {
 
-	/**
-	 * 
-	 */
-	private static final long serialVersionUID = -2615780504840628752L;
 
 	// 申报单编号
 	private String sbdbh;
@@ -35,7 +30,7 @@ public class DtywCbsbytHwEntity extends CjhsBaseEntity {
 	private String lzbz;
 	// 危险货物标志
 	private  String wxhwbz;
-	@Id
+
 	public String getSbdbh() {
 		return sbdbh;
 	}
@@ -90,4 +85,21 @@ public class DtywCbsbytHwEntity extends CjhsBaseEntity {
 	public void setWxhwbz(String wxhwbz) {
 		this.wxhwbz = wxhwbz;
 	}
+	
+	private Long  bsxh;
+	
+	private Long xh;
+	
+	public Long getBsxh() {
+		return bsxh;
+	}
+	public void setBsxh(Long bsxh) {
+		this.bsxh = bsxh;
+	}
+	public Long getXh() {
+		return xh;
+	}
+	public void setXh(Long xh) {
+		this.xh = xh;
+	}
 }

+ 2 - 7
gkaq/yjpt-java/trunk/java_src/com/jtgh/cjhs/entity/ZtzdCbzlViewEntity.java

@@ -1,7 +1,6 @@
 package com.jtgh.cjhs.entity;
 
 import javax.persistence.Entity;
-import javax.persistence.Id;
 import javax.persistence.Table;
 /**
  * 船舶种类字典
@@ -10,12 +9,8 @@ import javax.persistence.Table;
  */
 @Entity
 @Table(name = "ZTZD_CBZL_VIEW")
-public class ZtzdCbzlViewEntity extends CjhsBaseEntity {
+public class ZtzdCbzlViewEntity {
 
-	/**
-	 * 
-	 */
-	private static final long serialVersionUID = 4886151749092532252L;
 
 	//船中文名称
 	private  String cbzlzemc;
@@ -23,7 +18,7 @@ public class ZtzdCbzlViewEntity extends CjhsBaseEntity {
 	private  String zbzlywmc;
 	//有效标志
 	private  String yxbz;
-	@Id
+
 	public String getCbzlzemc() {
 		return cbzlzemc;
 	}

+ 2 - 7
gkaq/yjpt-java/trunk/java_src/com/jtgh/cjhs/entity/ZtzdGjViewEntity.java

@@ -1,7 +1,6 @@
 package com.jtgh.cjhs.entity;
 
 import javax.persistence.Entity;
-import javax.persistence.Id;
 import javax.persistence.Table;
 /**
  * 国籍字典表
@@ -10,12 +9,8 @@ import javax.persistence.Table;
  */
 @Entity
 @Table(name = "ZTZD_GJ_VIEW")
-public class ZtzdGjViewEntity extends CjhsBaseEntity {
+public class ZtzdGjViewEntity{
 
-	/**
-	 * 
-	 */
-	private static final long serialVersionUID = 632818078595594730L;
 
 	//国籍代码
 	private  String gjdm;
@@ -25,7 +20,7 @@ public class ZtzdGjViewEntity extends CjhsBaseEntity {
 	private  String gjywmc;
 	//有效标志
 	private  String yxbz;
-	@Id
+
 	public String getGjdm() {
 		return gjdm;
 	}

+ 3 - 7
gkaq/yjpt-java/trunk/java_src/com/jtgh/cjhs/entity/ZtzdGkmlViewEntity.java

@@ -1,7 +1,6 @@
 package com.jtgh.cjhs.entity;
 
 import javax.persistence.Entity;
-import javax.persistence.Id;
 import javax.persistence.Table;
 /**
  *港口名录字典表
@@ -10,12 +9,9 @@ import javax.persistence.Table;
  */
 @Entity
 @Table(name = "ZTZD_GKML_VIEW")
-public class ZtzdGkmlViewEntity extends CjhsBaseEntity  {
+public class ZtzdGkmlViewEntity {
+
 
-	/**
-	 * 
-	 */
-	private static final long serialVersionUID = -5933097578381919555L;
 	// 港口代码
 	private  String gkdm;
 	//港口名称
@@ -24,7 +20,7 @@ public class ZtzdGkmlViewEntity extends CjhsBaseEntity  {
 	private  String ywgkmc;
 	//有效 标志
 	private  String yxbz;
-	@Id
+	
 	public String getGkdm() {
 		return gkdm;
 	}

+ 133 - 0
gkaq/yjpt-java/trunk/java_src/com/jtgh/cjhs/service/CjhsBaseService.java

@@ -0,0 +1,133 @@
+package com.jtgh.cjhs.service;
+
+import java.io.Serializable;
+import java.util.List;
+
+import org.springframework.data.domain.Page;
+import org.springframework.data.domain.Pageable;
+import org.springframework.data.domain.Sort;
+import org.springframework.data.jpa.domain.Specification;
+
+import com.jtgh.cjhs.dao.common.CjhsRepository;
+
+public abstract class CjhsBaseService<T , ID extends Serializable>
+		implements CjhsRepository<T, ID> {
+
+	/**
+	 * 获取service执行Dao
+	 * 
+	 * @return
+	 */
+	protected abstract CjhsRepository<T, ID> getDao();
+
+	@Override
+	public T findOne(Specification<T> spec) {
+		return getDao().findOne(spec);
+	}
+
+	@Override
+	public List<T> findAll(Specification<T> spec) {
+		return getDao().findAll(spec);
+	}
+
+	@Override
+	public Page<T> findAll(Specification<T> spec, Pageable pageable) {
+		return getDao().findAll(spec, pageable);
+	}
+
+	@Override
+	public List<T> findAll(Specification<T> spec, Sort sort) {
+		return getDao().findAll(spec, sort);
+	}
+
+	@Override
+	public long count(Specification<T> spec) {
+		return getDao().count(spec);
+	}
+
+	@Override
+	public Page<T> findAll(Pageable pageable) {
+		return getDao().findAll(pageable);
+	}
+
+	@Override
+	public long count() {
+		return getDao().count();
+	}
+
+	@Override
+	public void delete(ID id) {
+		getDao().delete(id);
+	}
+
+	@Override
+	public void delete(T entity) {
+		getDao().delete(entity);
+	}
+
+	@Override
+	public void delete(Iterable<? extends T> entities) {
+		getDao().delete(entities);
+	}
+
+	@Override
+	public void deleteAll() {
+		getDao().deleteAll();
+	}
+
+	@Override
+	public boolean exists(ID id) {
+		return getDao().exists(id);
+	}
+
+	@Override
+	public T findOne(ID id) {
+		return getDao().findOne(id);
+	}
+
+	@Override
+	public <S extends T> S save(S entity) {
+		return getDao().save(entity);
+	}
+
+	@Override
+	public List<T> findAll() {
+		return getDao().findAll();
+	}
+
+	@Override
+	public List<T> findAll(Sort sort) {
+		return getDao().findAll(sort);
+	}
+
+	@Override
+	public List<T> findAll(Iterable<ID> ids) {
+		return getDao().findAll(ids);
+	}
+
+	@Override
+	public <S extends T> List<S> save(Iterable<S> entities) {
+		return getDao().save(entities);
+	}
+
+	@Override
+	public void flush() {
+		getDao().flush();
+	}
+
+	@Override
+	public T saveAndFlush(T entity) {
+		return getDao().saveAndFlush(entity);
+	}
+
+	@Override
+	public void deleteInBatch(Iterable<T> entities) {
+		getDao().deleteInBatch(entities);
+	}
+
+	@Override
+	public void deleteAllInBatch() {
+		getDao().deleteAllInBatch();
+	}
+
+}

+ 28 - 0
gkaq/yjpt-java/trunk/java_src/com/jtgh/cjhs/service/DtywCbsbService.java

@@ -0,0 +1,28 @@
+package com.jtgh.cjhs.service;
+
+import java.util.List;
+
+import org.springframework.data.domain.Page;
+import org.springframework.data.domain.Pageable;
+import org.springframework.data.jpa.domain.Specification;
+
+import com.jtgh.cjhs.entity.DtywCbsbEntity;
+
+/**
+ * 危险品申报信息
+ * @author 刘福亮
+ *
+ */
+
+public interface DtywCbsbService {
+
+	
+	public Page<DtywCbsbEntity> findAll(Specification<DtywCbsbEntity> spec,
+			Pageable pageable);
+	
+	public DtywCbsbEntity  findBySbdbh(String sbdbh);
+	
+	public List<DtywCbsbEntity> findByZwcm(String zwcm);
+	
+	
+}

+ 41 - 0
gkaq/yjpt-java/trunk/java_src/com/jtgh/cjhs/service/impl/DtywCbsbServiceImpl.java

@@ -0,0 +1,41 @@
+package com.jtgh.cjhs.service.impl;
+
+import java.util.List;
+
+import org.springframework.beans.factory.annotation.Autowired;
+
+import com.jtgh.cjhs.dao.DtywCbsbDao;
+import com.jtgh.cjhs.dao.common.CjhsRepository;
+import com.jtgh.cjhs.entity.DtywCbsbEntity;
+import com.jtgh.cjhs.service.CjhsBaseService;
+import com.jtgh.cjhs.service.DtywCbsbService;
+
+/**
+ * 危险品申报信息
+ * @author 刘福亮
+ *
+ */
+
+public class DtywCbsbServiceImpl extends
+CjhsBaseService<DtywCbsbEntity, String>  implements DtywCbsbService {
+	@Autowired
+	private DtywCbsbDao  dtywCbsbDao;
+
+	@Override
+	protected CjhsRepository<DtywCbsbEntity, String> getDao() {
+		return dtywCbsbDao;
+	}
+
+	@Override
+	public DtywCbsbEntity findBySbdbh(String sbdbh) {
+		return dtywCbsbDao.findOne(sbdbh);
+	}
+
+	@Override
+	public List<DtywCbsbEntity> findByZwcm(String zwcm) {
+
+		return dtywCbsbDao.findByZwcm(zwcm);
+	}
+
+	
+}