107 lines
3.3 KiB
Plaintext
107 lines
3.3 KiB
Plaintext
package com.nationalelectric.greenH5.handleQuerySql;
|
|
|
|
import java.util.List;
|
|
|
|
import org.apache.commons.collections.CollectionUtils;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.jdbc.core.BeanPropertyRowMapper;
|
|
import org.springframework.stereotype.Component;
|
|
|
|
import com.nationalelectric.greenH5.po.GreenHaircutComment;
|
|
import com.nationalelectric.greenH5.po.GreenHaircutInfo;
|
|
import com.nationalelectric.greenH5.po.GreenWashCarInfo;
|
|
import com.sgcc.uap.persistence.IHibernateDao;
|
|
|
|
/**
|
|
* @author 10488
|
|
* 隔离装置-处理查询使用
|
|
*/
|
|
@Component(value="HandleQuerySqlData")
|
|
public class HandleQuerySqlData {
|
|
|
|
@Autowired
|
|
IHibernateDao hibernateDao;
|
|
|
|
/**
|
|
* 理发
|
|
* @param id
|
|
* @return
|
|
*/
|
|
public GreenHaircutInfo handleData(Long id){
|
|
// 查询sql
|
|
String sql = "SELECT ID,BARBERSHOP_AREA,APPLY_DATE,APPLY_TIME,APPLY_TIME_ID,HAIRCUT_TYPE,"
|
|
+ "BARBER_ID,BARBER_NAME,DEPT_ID,DEPT_NAME,APPLY_PERSON_NAME,APPLY_PERSON_TEL,"
|
|
+ "USER_ID,CREATOR,MODIFIER,IS_DELETED,INT_STATUS,"
|
|
+ "to_char(GMT_CREATED,'yyyy-mm-dd hh24:mi:ss') AS \"GMT_CREATED\","
|
|
+ "to_char(GMT_MODIFIED,'yyyy-mm-dd hh24:mi:ss') AS \"GMT_MODIFIED\""
|
|
+ " FROM GREEN_HAIRCUT_INFO WHERE ID = ?";
|
|
List<GreenHaircutInfo> listData;
|
|
try {
|
|
listData = hibernateDao.queryForListWithSql(sql, new Object[] { id },
|
|
new BeanPropertyRowMapper<GreenHaircutInfo>(GreenHaircutInfo.class));
|
|
if(CollectionUtils.isNotEmpty(listData)){
|
|
return listData.get(0);
|
|
}else{
|
|
return new GreenHaircutInfo();
|
|
}
|
|
} catch (Exception e) {
|
|
return new GreenHaircutInfo();
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
* 洗车
|
|
* @param id
|
|
* @return
|
|
*/
|
|
public GreenWashCarInfo getWashCarInfoData(Long id){
|
|
// 查询sql
|
|
String sql = "SELECT ID,USER_ID,USER_NAME,APPLY_DATE,APPLY_TIME,APPLY_TIME_ID,DEPT_ID,DEPT_NAME,"
|
|
+ "CONCAT_USER_NAME,CONCAT_PHONE,UPD_USER,DEL_FLAG,APPLY_PLACE,LICENSEPLATE,STARTREMIND,"
|
|
+ "ENDREMIND,MOVE_CAR,INT_STATUS,IS_PUSH,"
|
|
+ "to_char(CREATE_TIME,'yyyy-mm-dd hh24:mi:ss') AS \"CREATE_TIME\","
|
|
+ "to_char(UPD_TIME,'yyyy-mm-dd hh24:mi:ss') AS \"UPD_TIME\""
|
|
+ " FROM GREEN_WASH_CAR_INFO WHERE ID = ?";
|
|
List<GreenWashCarInfo> listData;
|
|
try {
|
|
listData = hibernateDao.queryForListWithSql(sql, new Object[] { id },
|
|
new BeanPropertyRowMapper<GreenWashCarInfo>(GreenWashCarInfo.class));
|
|
if(CollectionUtils.isNotEmpty(listData)){
|
|
return listData.get(0);
|
|
}else{
|
|
return null;
|
|
}
|
|
} catch (Exception e) {
|
|
return null;
|
|
}
|
|
}
|
|
|
|
/**
|
|
* 理发评论
|
|
* @param id
|
|
* @return
|
|
*/
|
|
public GreenHaircutComment getHaircutCommentData(Long id){
|
|
// 查询sql
|
|
String sql = "SELECT ID,DETAIL_ID,TYPE,APPLICANT_NAME,APPLICANT_NAME,COMMENT_CONTENT,"
|
|
+ "USER_ID,CREATOR,MODIFIER,IS_DELETED,"
|
|
+ "to_char(GMT_CREATED,'yyyy-mm-dd hh24:mi:ss') AS \"GMT_CREATED\","
|
|
+ "to_char(GMT_MODIFIED,'yyyy-mm-dd hh24:mi:ss') AS \"GMT_MODIFIED\""
|
|
+ " FROM GREEN_HAIRCUT_COMMENT WHERE ID = ?";
|
|
List<GreenHaircutComment> listData;
|
|
try {
|
|
listData = hibernateDao.queryForListWithSql(sql, new Object[] { id },
|
|
new BeanPropertyRowMapper<GreenHaircutComment>(GreenHaircutComment.class));
|
|
if(CollectionUtils.isNotEmpty(listData)){
|
|
return listData.get(0);
|
|
}else{
|
|
return null;
|
|
}
|
|
} catch (Exception e) {
|
|
return null;
|
|
}
|
|
}
|
|
|
|
}
|