Commit de89b0fc by XiaHou

查询展览纪念馆

parent 3386692a
package com.atlgroupasia.servicecenter.common;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
* Bean 工具类
*
* @author kachexing
*/
public class BeanUtils extends org.springframework.beans.BeanUtils {
/**
* Bean方法名中属性名开始的下标
*/
private static final int BEAN_METHOD_PROP_INDEX = 3;
/**
* 匹配getter方法的正则表达式
*/
private static final Pattern GET_PATTERN = Pattern.compile("get(\\p{javaUpperCase}\\w*)");
/**
* 匹配setter方法的正则表达式
*/
private static final Pattern SET_PATTERN = Pattern.compile("set(\\p{javaUpperCase}\\w*)");
/**
* Bean属性复制工具方法。
*
* @param dest 目标对象
* @param src 源对象
*/
public static void copyBeanProp(Object dest, Object src) {
try {
copyProperties(src, dest);
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* 获取对象的setter方法。
*
* @param obj 对象
* @return 对象的setter方法列表
*/
public static List<Method> getSetterMethods(Object obj) {
// setter方法列表
List<Method> setterMethods = new ArrayList<Method>();
// 获取所有方法
Method[] methods = obj.getClass().getMethods();
// 查找setter方法
for (Method method : methods) {
Matcher m = SET_PATTERN.matcher(method.getName());
if (m.matches() && (method.getParameterTypes().length == 1)) {
setterMethods.add(method);
}
}
// 返回setter方法列表
return setterMethods;
}
/**
* 获取对象的getter方法。
*
* @param obj 对象
* @return 对象的getter方法列表
*/
public static List<Method> getGetterMethods(Object obj) {
// getter方法列表
List<Method> getterMethods = new ArrayList<Method>();
// 获取所有方法
Method[] methods = obj.getClass().getMethods();
// 查找getter方法
for (Method method : methods) {
Matcher m = GET_PATTERN.matcher(method.getName());
if (m.matches() && (method.getParameterTypes().length == 0)) {
getterMethods.add(method);
}
}
// 返回getter方法列表
return getterMethods;
}
/**
* 检查Bean方法名中的属性名是否相等。<br>
* 如getName()和setName()属性名一样,getName()和setAge()属性名不一样。
*
* @param m1 方法名1
* @param m2 方法名2
* @return 属性名一样返回true,否则返回false
*/
public static boolean isMethodPropEquals(String m1, String m2) {
return m1.substring(BEAN_METHOD_PROP_INDEX).equals(m2.substring(BEAN_METHOD_PROP_INDEX));
}
}
package com.atlgroupasia.servicecenter.controller;
import com.atlgroupasia.servicecenter.common.Page;
import com.atlgroupasia.servicecenter.operation.exhibit.pojo.QueryAppointmentParam;
import com.atlgroupasia.servicecenter.operation.exhibit.service.IOshAppointmentService;
import com.atlgroupasia.servicecenter.utils.JsonResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
/**
* @Author xh
* @Date 2020/12/2
* description:
*/
@Controller
@Api(tags = "纪念馆预约相关接口", description = "纪念馆预约控制器")
@RequestMapping("/oshAppointment")
public class OshAppointmentController {
@Autowired
private IOshAppointmentService oshAppointmentService;
@ApiOperation("分页查询纪念馆预约记录")
@RequestMapping(value = "/selectExhibitListByOther", method = RequestMethod.POST)
@ResponseBody
public JsonResult selectExhibitListByOther(@ModelAttribute Page page,
@ModelAttribute QueryAppointmentParam queryAppointmentParam) {
return JsonResult.success("查询成功", this.oshAppointmentService.selectExhibitListByOther(queryAppointmentParam, page));
}
}
package com.atlgroupasia.servicecenter.controller;
import com.atlgroupasia.servicecenter.common.Page;
import com.atlgroupasia.servicecenter.operation.exhibit.pojo.InsertOshAppointmentParam;
import com.atlgroupasia.servicecenter.operation.exhibit.pojo.QueryExhibitParam;
import com.atlgroupasia.servicecenter.operation.exhibit.service.IOshAppointmentService;
import com.atlgroupasia.servicecenter.operation.exhibit.service.IOshExhibitService;
import com.atlgroupasia.servicecenter.utils.JsonResult;
import io.swagger.annotations.Api;
......@@ -25,12 +27,22 @@ public class OshExhibitController {
@Autowired
private IOshExhibitService oshExhibitService;
@Autowired
private IOshAppointmentService oshAppointmentService;
@ApiOperation("分页查询展览纪念馆")
@RequestMapping(value = "/selectExhibitListByOther", method = RequestMethod.GET)
@RequestMapping(value = "/selectExhibitListByOther", method = RequestMethod.POST)
@ResponseBody
public JsonResult selectExhibitListByOther(@ModelAttribute Page page,
@ModelAttribute QueryExhibitParam queryExhibitParam) {
return JsonResult.success("查询成功", this.oshExhibitService.selectExhibitListByOther(queryExhibitParam, page));
}
@ApiOperation("提交现场纪念馆预约申请")
@RequestMapping(value = "/InsertOshAppointmentParam", method = RequestMethod.POST)
@ResponseBody
public JsonResult InsertOshAppointmentParam(@ModelAttribute InsertOshAppointmentParam insertOshAppointmentParam) {
return oshAppointmentService.insertOshAppointmentParam(insertOshAppointmentParam);
}
}
package com.atlgroupasia.servicecenter.mbg.mapper;
import com.atlgroupasia.servicecenter.mbg.po.OshAppointmentApply;
import com.atlgroupasia.servicecenter.mbg.po.OshAppointmentApplyExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface OshAppointmentApplyMapper {
long countByExample(OshAppointmentApplyExample example);
int deleteByExample(OshAppointmentApplyExample example);
int deleteByPrimaryKey(Integer id);
int insert(OshAppointmentApply record);
int insertSelective(OshAppointmentApply record);
List<OshAppointmentApply> selectByExample(OshAppointmentApplyExample example);
OshAppointmentApply selectByPrimaryKey(Integer id);
int updateByExampleSelective(@Param("record") OshAppointmentApply record, @Param("example") OshAppointmentApplyExample example);
int updateByExample(@Param("record") OshAppointmentApply record, @Param("example") OshAppointmentApplyExample example);
int updateByPrimaryKeySelective(OshAppointmentApply record);
int updateByPrimaryKey(OshAppointmentApply record);
}
\ No newline at end of file
package com.atlgroupasia.servicecenter.mbg.mapper;
import com.atlgroupasia.servicecenter.mbg.po.OshAppointment;
import com.atlgroupasia.servicecenter.mbg.po.OshAppointmentExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface OshAppointmentMapper {
long countByExample(OshAppointmentExample example);
int deleteByExample(OshAppointmentExample example);
int deleteByPrimaryKey(Integer id);
int insert(OshAppointment record);
int insertSelective(OshAppointment record);
List<OshAppointment> selectByExample(OshAppointmentExample example);
OshAppointment selectByPrimaryKey(Integer id);
int updateByExampleSelective(@Param("record") OshAppointment record, @Param("example") OshAppointmentExample example);
int updateByExample(@Param("record") OshAppointment record, @Param("example") OshAppointmentExample example);
int updateByPrimaryKeySelective(OshAppointment record);
int updateByPrimaryKey(OshAppointment record);
}
\ No newline at end of file
package com.atlgroupasia.servicecenter.mbg.po;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.*;
import org.springframework.format.annotation.DateTimeFormat;
@Entity
public class OshAppointmentApply implements Serializable {
@Id
@GeneratedValue(strategy= GenerationType.IDENTITY)
private Integer id;
@ApiModelProperty(value = "关联id")
private Integer relationId;
@ApiModelProperty(value = "0参馆 1法会")
private Integer type;
@ApiModelProperty(value = "用户id")
private Integer userId;
@ApiModelProperty(value = "预约id")
private Integer appointmentId;
@ApiModelProperty(value = "审核状态0未审核。1,已通过2.未通过")
private Integer meetingState;
@ApiModelProperty(value = "报名时间")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date createTime;
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date updatetime;
private Integer isDel;
private static final long serialVersionUID = 1L;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getRelationId() {
return relationId;
}
public void setRelationId(Integer relationId) {
this.relationId = relationId;
}
public Integer getType() {
return type;
}
public void setType(Integer type) {
this.type = type;
}
public Integer getUserId() {
return userId;
}
public void setUserId(Integer userId) {
this.userId = userId;
}
public Integer getAppointmentId() {
return appointmentId;
}
public void setAppointmentId(Integer appointmentId) {
this.appointmentId = appointmentId;
}
public Integer getMeetingState() {
return meetingState;
}
public void setMeetingState(Integer meetingState) {
this.meetingState = meetingState;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Date getUpdatetime() {
return updatetime;
}
public void setUpdatetime(Date updatetime) {
this.updatetime = updatetime;
}
public Integer getIsDel() {
return isDel;
}
public void setIsDel(Integer isDel) {
this.isDel = isDel;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", relationId=").append(relationId);
sb.append(", type=").append(type);
sb.append(", userId=").append(userId);
sb.append(", appointmentId=").append(appointmentId);
sb.append(", meetingState=").append(meetingState);
sb.append(", createTime=").append(createTime);
sb.append(", updatetime=").append(updatetime);
sb.append(", isDel=").append(isDel);
sb.append(", serialVersionUID=").append(serialVersionUID);
sb.append("]");
return sb.toString();
}
}
\ No newline at end of file
package com.atlgroupasia.servicecenter.operation.exhibit.dao;
import com.atlgroupasia.servicecenter.operation.exhibit.pojo.QueryAppointmentParam;
import com.atlgroupasia.servicecenter.operation.exhibit.pojo.QueryAppointmentVO;
import java.util.List;
/**
* @Author xh
* @Date 2021/4/15
* description:
*/
public interface OshAppointmentDao {
/**
* 分页查询预约申请
*
* @param queryAppointmentParam
* @return
*/
List<QueryAppointmentVO> selectExhibitListByOther(QueryAppointmentParam queryAppointmentParam);
}
package com.atlgroupasia.servicecenter.operation.exhibit.pojo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* @Author xh
* @Date 2021/4/19
* description:
*/
@Data
public class InsertOshAppointmentParam implements Serializable {
@ApiModelProperty(value = "用户id")
private Integer userId;
@ApiModelProperty(value = "关联寺庙Id")
private Integer referId;
@ApiModelProperty(value = "人数")
private Integer person;
@ApiModelProperty(value = "参观结束时间")
private Date endTime;
@ApiModelProperty(value = "参观开始时间")
private Date beginTime;
@ApiModelProperty(value = "是否用餐;0否;1是")
private Integer haveDinner;
@ApiModelProperty(value = "用餐人数")
private Integer dinnerPerson;
@ApiModelProperty(value = "联系人姓名")
private String contactName;
@ApiModelProperty(value = "联系人电话")
private String contactPhone;
@ApiModelProperty(value = "联系人身份证")
private String contactIdentify;
@ApiModelProperty(value = "到达时间")
private Date arriveTime;
}
package com.atlgroupasia.servicecenter.operation.exhibit.pojo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
/**
* @Author xh
* @Date 2021/4/20
* description:
*/
@Data
public class QueryAppointmentParam implements Serializable {
@ApiModelProperty(value = "预约状态 0 未处理 1 已处理")
private Integer isContact;
@ApiModelProperty(value = "关联类型;0代表参馆;1代表参加法会活动 默认要传0")
private Integer referType;
@ApiModelProperty(value = "用户Id")
private Integer userId;
}
package com.atlgroupasia.servicecenter.operation.exhibit.pojo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
/**
* @Author xh
* @Date 2021/4/20
* description:
*/
@Data
public class QueryAppointmentVO implements Serializable {
@ApiModelProperty(value = "预约id")
private Integer appointmentId;
@ApiModelProperty(value = "参馆名称")
private String templeName;
@ApiModelProperty(value = "联系人")
private String contactName;
@ApiModelProperty(value = "联系人电话")
private String contactPhone;
@ApiModelProperty(value = "联系人身份证")
private String contactIdentify;
@ApiModelProperty(value = "参馆结束时间")
private String endTime;
@ApiModelProperty(value = "参观起始时间")
private String beginTime;
@ApiModelProperty(value = "是否用餐")
private Integer haveDinner;
@ApiModelProperty(value = "用餐人数")
private Integer dinnerPerson;
@ApiModelProperty(value = "到达时间")
private String arriveTime;
}
package com.atlgroupasia.servicecenter.operation.exhibit.service;
import com.atlgroupasia.servicecenter.common.CommonPage;
import com.atlgroupasia.servicecenter.common.Page;
import com.atlgroupasia.servicecenter.operation.exhibit.pojo.InsertOshAppointmentParam;
import com.atlgroupasia.servicecenter.operation.exhibit.pojo.QueryAppointmentParam;
import com.atlgroupasia.servicecenter.operation.exhibit.pojo.QueryAppointmentVO;
import com.atlgroupasia.servicecenter.utils.JsonResult;
/**
* @Author xh
* @Date 2021/4/15
* description:
*/
public interface IOshAppointmentService {
/**
* 插入预约申请
*
* @param insertOshAppointmentParam
* @return
*/
JsonResult insertOshAppointmentParam(InsertOshAppointmentParam insertOshAppointmentParam);
/**
* 分页查询预约列表
*
* @param queryAppointmentParam
* @param page
* @return
*/
CommonPage<QueryAppointmentVO> selectExhibitListByOther(QueryAppointmentParam queryAppointmentParam, Page page);
}
......@@ -2,8 +2,10 @@ package com.atlgroupasia.servicecenter.operation.exhibit.service;
import com.atlgroupasia.servicecenter.common.CommonPage;
import com.atlgroupasia.servicecenter.common.Page;
import com.atlgroupasia.servicecenter.operation.exhibit.pojo.InsertOshAppointmentParam;
import com.atlgroupasia.servicecenter.operation.exhibit.pojo.QueryExhibitParam;
import com.atlgroupasia.servicecenter.operation.exhibit.pojo.QueryExhibitVO;
import com.atlgroupasia.servicecenter.utils.JsonResult;
/**
* @Author xh
......@@ -14,10 +16,12 @@ public interface IOshExhibitService {
/**
* 分页查询 可展览机娘
*
* @param queryExhibitParam
* @param page
* @return
*/
CommonPage<QueryExhibitVO> selectExhibitListByOther(QueryExhibitParam queryExhibitParam, Page page);
}
package com.atlgroupasia.servicecenter.operation.exhibit.service.impl;
import com.atlgroupasia.servicecenter.common.BeanUtils;
import com.atlgroupasia.servicecenter.common.CommonPage;
import com.atlgroupasia.servicecenter.common.Constants;
import com.atlgroupasia.servicecenter.common.Page;
import com.atlgroupasia.servicecenter.mbg.mapper.OshAppointmentApplyMapper;
import com.atlgroupasia.servicecenter.mbg.mapper.OshAppointmentMapper;
import com.atlgroupasia.servicecenter.mbg.mapper.OshExhibitMapper;
import com.atlgroupasia.servicecenter.mbg.po.OshAppointment;
import com.atlgroupasia.servicecenter.mbg.po.OshAppointmentApply;
import com.atlgroupasia.servicecenter.operation.exhibit.dao.OshAppointmentDao;
import com.atlgroupasia.servicecenter.operation.exhibit.dao.OshExhibitDao;
import com.atlgroupasia.servicecenter.operation.exhibit.pojo.*;
import com.atlgroupasia.servicecenter.operation.exhibit.service.IOshAppointmentService;
import com.atlgroupasia.servicecenter.operation.exhibit.service.IOshExhibitService;
import com.atlgroupasia.servicecenter.utils.JsonResult;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.List;
/**
* @Author xh
* @Date 2021/4/15
* description:
*/
@Service
public class OshAppointmentServiceImpl implements IOshAppointmentService {
@Resource
private OshAppointmentMapper oshAppointmentMapper;
@Resource
private OshAppointmentDao oshAppointmentDao;
@Resource
private OshAppointmentApplyMapper oshAppointmentApplyMapper;
/**
* 插入预约申请
*
* @param insertOshAppointmentParam
* @return
*/
@Override
@Transactional(rollbackFor = Exception.class)
public JsonResult insertOshAppointmentParam(InsertOshAppointmentParam insertOshAppointmentParam) {
JsonResult res = this.check(insertOshAppointmentParam);
if(res.getStatus().equals(Constants.RESPONSE_STATUS_500)){
return res;
}
//插入预约记录表
OshAppointment oshAppointment = new OshAppointment();
BeanUtils.copyProperties(insertOshAppointmentParam, oshAppointment);
this.oshAppointmentMapper.insertSelective(oshAppointment);
return JsonResult.success("提交成功");
}
/**
* 分页查询预约列表
*
* @param queryAppointmentParam
* @param page
* @return
*/
@Override
public CommonPage<QueryAppointmentVO> selectExhibitListByOther(QueryAppointmentParam queryAppointmentParam, Page page){
if (page != null && page.getPageNum() != null && page.getPageSize() != null) {
PageHelper.startPage(page.getPageNum(), page.getPageSize());
}
List<QueryAppointmentVO> queryExhibitVOList = this.oshAppointmentDao.selectExhibitListByOther(queryAppointmentParam);
//记录下 pagehelper第一次分页查询的 返回得总条数 等信息
PageInfo<QueryAppointmentVO> pageInfo = new PageInfo<>(queryExhibitVOList);
//因为进行了第二次查询 所以pageHelp得分页总数得到了变化 导致不准确 因此我们需要手动校准一下
CommonPage<QueryAppointmentVO> result = new CommonPage<QueryAppointmentVO>();
result.setTotalPage(pageInfo.getPages());
result.setPageNum(pageInfo.getPageNum());
result.setPageSize(pageInfo.getPageSize());
result.setTotal(pageInfo.getTotal());
result.setList(queryExhibitVOList);
return result;
}
/**
* 校验插入对象
*
* @param insertOshAppointmentParam
* @return
*/
private JsonResult check(InsertOshAppointmentParam insertOshAppointmentParam) {
if(insertOshAppointmentParam.getPerson() == null){
return JsonResult.failed("传入人数为空");
}
if(insertOshAppointmentParam.getReferId() == null ){
return JsonResult.failed("传入关联id为空");
}
if(insertOshAppointmentParam.getEndTime() == null || insertOshAppointmentParam.getBeginTime() == null){
return JsonResult.failed("传入时间段不能为空!");
}
if(insertOshAppointmentParam.getContactName() == null || insertOshAppointmentParam.getContactName().isEmpty()){
return JsonResult.failed("传入联系人不能为空!");
}
if(insertOshAppointmentParam.getContactPhone() == null ||insertOshAppointmentParam.getContactPhone().isEmpty()){
return JsonResult.failed("传入联系电话不能为空!");
}
if(insertOshAppointmentParam.getUserId() == null){
return JsonResult.failed("传入用户Id不能为空!");
}
return JsonResult.success("校验通过");
}
}
package com.atlgroupasia.servicecenter.operation.exhibit.service.impl;
import com.atlgroupasia.servicecenter.common.BeanUtils;
import com.atlgroupasia.servicecenter.common.CommonPage;
import com.atlgroupasia.servicecenter.common.Constants;
import com.atlgroupasia.servicecenter.common.Page;
import com.atlgroupasia.servicecenter.mbg.mapper.OshAppointmentMapper;
import com.atlgroupasia.servicecenter.mbg.mapper.OshExhibitMapper;
import com.atlgroupasia.servicecenter.mbg.po.OshAppointment;
import com.atlgroupasia.servicecenter.operation.exhibit.dao.OshExhibitDao;
import com.atlgroupasia.servicecenter.operation.exhibit.pojo.InsertOshAppointmentParam;
import com.atlgroupasia.servicecenter.operation.exhibit.pojo.QueryExhibitParam;
import com.atlgroupasia.servicecenter.operation.exhibit.pojo.QueryExhibitVO;
import com.atlgroupasia.servicecenter.operation.exhibit.service.IOshExhibitService;
import com.atlgroupasia.servicecenter.utils.JsonResult;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.List;
import java.util.stream.Collectors;
/**
* @Author xh
......@@ -27,16 +33,18 @@ public class OshExhibitServiceImpl implements IOshExhibitService {
private OshExhibitMapper oshExhibitMapper;
@Resource
private OshExhibitDao oshExhibitDao;
@Resource
private OshAppointmentMapper oshAppointmentMapper;
/**
* 分页查询 可展览机娘
*
* @param queryExhibitParam
* @param page
* @return
*/
@Override
public CommonPage<QueryExhibitVO> selectExhibitListByOther(QueryExhibitParam queryExhibitParam, Page page){
public CommonPage<QueryExhibitVO> selectExhibitListByOther(QueryExhibitParam queryExhibitParam, Page page) {
if (page != null && page.getPageNum() != null && page.getPageSize() != null) {
PageHelper.startPage(page.getPageNum(), page.getPageSize());
}
......
......@@ -10,13 +10,13 @@ spring:
#���ݿ�����
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
#url: jdbc:mysql://lmerp001w.mysql.rds.aliyuncs.com/lmerp?characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai
#username: test_erp
#password: Fzii591com
url: jdbc:mysql://lmerp001w.mysql.rds.aliyuncs.com/lmerp?characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai
username: test_erp
password: Fzii591com
url: jdbc:mysql://47.98.216.76:3306/atl-service-center?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
username: root
password: 6just@2019
#url: jdbc:mysql://47.98.216.76:3306/atl-service-center?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
#username: root
#password: 6just@2019
type: com.alibaba.druid.pool.DruidDataSource
......@@ -33,13 +33,13 @@ spring:
# Redis数据库索引(默认为0)
database: 0
# Redis服务器地址
host: 47.98.96.174
#host: 127.0.0.1
#host: 47.98.96.174
host: 127.0.0.1
# Redis服务器连接端口
port: 6379
# Redis服务器连接密码(默认为空)
password: "root123!!"
#password: ""
#password: "root123!!"
password: ""
#password: atl@redis_120726
jedis:
pool:
......@@ -55,14 +55,14 @@ spring:
timeout: 5000
server:
port: 8099
port: 9091
#����myba
#配置mybatis
mybatis:
mapper-locations: classpath:mapper/**/*.xml
#全局的映射,不用在xml文件写实体类的全路径
type-aliases-package: com.atlgroupasia.servicecenter
type-aliases-package: com.atlgroupasia.servicecenter.mbg.mapper
#开启驼峰映射
configuration:
map-underscore-to-camel-case: true
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.atlgroupasia.servicecenter.operation.exhibit.dao.OshAppointmentDao">
<resultMap id="baseResultMap" type="com.atlgroupasia.servicecenter.mbg.po.OshAppointment" extends="com.atlgroupasia.servicecenter.mbg.mapper.OshAppointmentMapper.BaseResultMap">
</resultMap>
<select id="selectExhibitListByOther" parameterType="com.atlgroupasia.servicecenter.operation.exhibit.pojo.QueryAppointmentParam" resultType="com.atlgroupasia.servicecenter.operation.exhibit.pojo.QueryAppointmentVO">
select
a.id appointmentId,a.contact_name contactName,a.contact_phone contactPhone,a.contact_identify contactIdentify,
a.end_time endTime,a.begin_time beginTime,a.have_dinner haveDinner,a.dinner_person dinnerPerson,a.arrive_time arriveTime,
b.name templeName
from osh_appointment a
left join mis_temple b ON a.refer_id = b.id
where a.is_del = 0
<if test="userId != null">
and a.user_id =#{userId}
</if>
<if test="referType != null">
and a.refer_type =#{referType}
</if>
<if test="isContact != null">
and a.is_contact = #{isContact}
</if>
</select>
</mapper>
\ No newline at end of file
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