# Conflicts: # hai-service/src/main/java/com/hai/openApi/service/impl/ApiOrderCreateHandleServiceImpl.java # hai-service/src/main/java/com/hai/openApi/service/impl/ApiOrderServiceImpl.javamaster
parent
935f495a1c
commit
d752345fb2
File diff suppressed because one or more lines are too long
@ -0,0 +1,344 @@ |
||||
package com.cweb.controller.Etc; |
||||
|
||||
import com.alibaba.fastjson.JSONObject; |
||||
import com.hai.common.exception.ErrorCode; |
||||
import com.hai.common.exception.ErrorHelp; |
||||
import com.hai.common.exception.SysCode; |
||||
import com.hai.common.security.SessionObject; |
||||
import com.hai.common.security.UserCenter; |
||||
import com.hai.common.utils.ResponseMsgUtil; |
||||
import com.hai.config.EtcService; |
||||
import com.hai.entity.EtcCarMsg; |
||||
import com.hai.entity.EtcContractOrder; |
||||
import com.hai.entity.EtcCustMsg; |
||||
import com.hai.entity.SecDictionary; |
||||
import com.hai.etc.EtcCarMsgService; |
||||
import com.hai.etc.EtcCustMsgService; |
||||
import com.hai.model.HighUserModel; |
||||
import com.hai.model.ResponseData; |
||||
import com.hai.model.UserInfoModel; |
||||
import com.hai.service.CommonService; |
||||
import io.swagger.annotations.Api; |
||||
import io.swagger.annotations.ApiOperation; |
||||
import org.slf4j.Logger; |
||||
import org.slf4j.LoggerFactory; |
||||
import org.springframework.web.bind.annotation.*; |
||||
|
||||
import javax.annotation.Resource; |
||||
import javax.servlet.http.HttpServletRequest; |
||||
import java.util.*; |
||||
|
||||
@RestController |
||||
@RequestMapping(value="/etcCustomer") |
||||
@Api(value="etc客户信息") |
||||
public class EtcCustomerController { |
||||
|
||||
Logger log = LoggerFactory.getLogger(EtcCustomerController.class); |
||||
|
||||
@Resource |
||||
private UserCenter userCenter; |
||||
|
||||
@Resource |
||||
private EtcCustMsgService etcCustMsgService; |
||||
|
||||
@Resource |
||||
private EtcCarMsgService etcCarMsgService; |
||||
|
||||
@RequestMapping(value = "/getEtcCarMsgList", method = RequestMethod.GET) |
||||
@ResponseBody |
||||
@ApiOperation(value = "查询车辆列表") |
||||
public ResponseData getEtcCarList( |
||||
HttpServletRequest request |
||||
) { |
||||
try { |
||||
|
||||
SessionObject sessionObject = userCenter.getSessionObject(request); |
||||
HighUserModel userInfoModel = (HighUserModel) sessionObject.getObject(); |
||||
|
||||
|
||||
|
||||
Map<String, Object> mapUser = new HashMap<>(); |
||||
|
||||
mapUser.put("phone" , userInfoModel.getHighUser().getPhone()); |
||||
mapUser.put("status" , 2); |
||||
|
||||
EtcCustMsg etcCustMsg = etcCustMsgService.findEtcCustByMap(mapUser); |
||||
|
||||
if (etcCustMsg == null) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未查询到任何车辆!"); |
||||
} |
||||
|
||||
Map<String, Object> map = new HashMap<>(); |
||||
map.put("custId" , etcCustMsg.getCustId()); |
||||
|
||||
return ResponseMsgUtil.success(etcCarMsgService.getEtcCarList(map)); |
||||
|
||||
} catch (Exception e) { |
||||
log.error("BsMsgController --> getMsgByList() error!", e); |
||||
return ResponseMsgUtil.exception(e); |
||||
} |
||||
} |
||||
|
||||
@RequestMapping(value = "/getEtcContractOrderList", method = RequestMethod.GET) |
||||
@ResponseBody |
||||
@ApiOperation(value = "查询合同订单列表") |
||||
public ResponseData getEtcContractOrderList( |
||||
@RequestParam(value = "signStatus", required = false) String signStatus, HttpServletRequest request |
||||
) { |
||||
try { |
||||
|
||||
SessionObject sessionObject = userCenter.getSessionObject(request); |
||||
HighUserModel userInfoModel = (HighUserModel) sessionObject.getObject(); |
||||
|
||||
Map<String, Object> mapUser = new HashMap<>(); |
||||
|
||||
mapUser.put("phone" , userInfoModel.getHighUser().getPhone()); |
||||
mapUser.put("status" , 2); |
||||
|
||||
EtcCustMsg etcCustMsg = etcCustMsgService.findEtcCustByMap(mapUser); |
||||
|
||||
if (etcCustMsg == null) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未查询到合同!"); |
||||
} |
||||
|
||||
Map<String, Object> map = new HashMap<>(); |
||||
|
||||
map.put("custId" , etcCustMsg.getCustId()); |
||||
map.put("signStatus" , signStatus); |
||||
map.put("status" , 1); |
||||
|
||||
return ResponseMsgUtil.success(etcCarMsgService.getEtcContractOrderList(map)); |
||||
|
||||
} catch (Exception e) { |
||||
log.error("BsMsgController --> getMsgByList() error!", e); |
||||
return ResponseMsgUtil.exception(e); |
||||
} |
||||
} |
||||
|
||||
@RequestMapping(value = "/findContractOrderById", method = RequestMethod.GET) |
||||
@ResponseBody |
||||
@ApiOperation(value = "查询合同订单详情") |
||||
public ResponseData findContractOrderById( |
||||
@RequestParam(value = "id", required = false) Long id |
||||
) { |
||||
try { |
||||
|
||||
return ResponseMsgUtil.success(etcCarMsgService.findContractOrderById(id)); |
||||
|
||||
} catch (Exception e) { |
||||
log.error("BsMsgController --> getMsgByList() error!", e); |
||||
return ResponseMsgUtil.exception(e); |
||||
} |
||||
} |
||||
|
||||
@RequestMapping(value = "/sendSignVerifyCode", method = RequestMethod.GET) |
||||
@ResponseBody |
||||
@ApiOperation(value = "签约验证码发送接口") |
||||
public ResponseData sendSignVerifyCode(@RequestParam(value = "id", required = true) Long id) { |
||||
try { |
||||
|
||||
|
||||
EtcContractOrder contractOrder = etcCarMsgService.findContractOrderById(id); |
||||
|
||||
if (contractOrder == null) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "状态错误!"); |
||||
} |
||||
|
||||
JSONObject object = EtcService.sendSignVerifyCode(contractOrder.getCustId()); |
||||
|
||||
if (object.getString("errCode").equals("0")) { |
||||
return ResponseMsgUtil.success("请求成功!"); |
||||
} |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, object.getString("errMsg")); |
||||
|
||||
} catch (Exception e) { |
||||
log.error("HighUserController --> findByUserId() error!", e); |
||||
return ResponseMsgUtil.exception(e); |
||||
} |
||||
} |
||||
|
||||
@RequestMapping(value = "/checkSignVerifyCode", method = RequestMethod.GET) |
||||
@ResponseBody |
||||
@ApiOperation(value = "签约验证码核验接口") |
||||
public ResponseData checkSignVerifyCode(@RequestParam(value = "id", required = true) Long id , |
||||
@RequestParam(value = "signImg", required = true) String signImg , |
||||
@RequestParam(value = "verifyCode", required = true) String verifyCode ) { |
||||
try { |
||||
|
||||
EtcContractOrder contractOrder = etcCarMsgService.findContractOrderById(id); |
||||
|
||||
if (contractOrder == null) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "状态错误!"); |
||||
} |
||||
|
||||
contractOrder.setSignImg(signImg); |
||||
contractOrder.setUpdateTime(new Date()); |
||||
|
||||
etcCarMsgService.updateContractOrder(contractOrder); |
||||
|
||||
JSONObject object = EtcService.checkSignVerifyCode(contractOrder.getCustId() , verifyCode); |
||||
|
||||
if (object.getString("errCode").equals("0")) { |
||||
|
||||
Map<String , Object> mapCar = new HashMap<>(); |
||||
mapCar.put("vehId" , contractOrder.getVehId()); |
||||
mapCar.put("custId" , contractOrder.getCustId()); |
||||
|
||||
EtcCarMsg carMsg = etcCarMsgService.findEtcCarByMap(mapCar); |
||||
|
||||
carMsg.setSignStatus(1); |
||||
carMsg.setUpdateTime(new Date()); |
||||
carMsg.setVehStatus(15); |
||||
|
||||
etcCarMsgService.updateEtcCar(carMsg); |
||||
|
||||
contractOrder.setSignStatus(1); |
||||
etcCarMsgService.updateContractOrder(contractOrder); |
||||
|
||||
return ResponseMsgUtil.success("请求成功!"); |
||||
} |
||||
|
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, object.getString("errMsg")); |
||||
|
||||
} catch (Exception e) { |
||||
log.error("HighUserController --> findByUserId() error!", e); |
||||
return ResponseMsgUtil.exception(e); |
||||
} |
||||
} |
||||
|
||||
@RequestMapping(value = "/getSignContractTemplate", method = RequestMethod.GET) |
||||
@ResponseBody |
||||
@ApiOperation(value = "获取签约合同模板") |
||||
public ResponseData getSignContractTemplate(@RequestParam(value = "contractId", required = true) Long contractId ) { |
||||
try { |
||||
|
||||
EtcContractOrder contractOrder = etcCarMsgService.findContractOrderById(contractId); |
||||
|
||||
if (contractOrder == null) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "状态错误!"); |
||||
} |
||||
|
||||
JSONObject object = EtcService.getSignContractTemplate(contractOrder.getCustId() , contractOrder.getProductId() , contractOrder.getCardVarietyId()); |
||||
|
||||
if (object.getString("errCode").equals("0")) { |
||||
JSONObject jsonObject = (JSONObject) object.getJSONArray("result").get(0); |
||||
return ResponseMsgUtil.success(jsonObject.getString("url")); |
||||
} |
||||
|
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, object.getString("errMsg")); |
||||
|
||||
} catch (Exception e) { |
||||
log.error("HighUserController --> findByUserId() error!", e); |
||||
return ResponseMsgUtil.exception(e); |
||||
} |
||||
} |
||||
|
||||
@RequestMapping(value = "/checkNeedSign", method = RequestMethod.GET) |
||||
@ResponseBody |
||||
@ApiOperation(value = "查看是否需要签约代扣") |
||||
public ResponseData checkNeedSign(@RequestParam(value = "contractId", required = true) Long contractId, |
||||
@RequestParam(value = "type", required = true) Integer type) { |
||||
try { |
||||
|
||||
|
||||
EtcContractOrder contractOrder = etcCarMsgService.findContractOrderById(contractId); |
||||
|
||||
if (type == 1) { |
||||
JSONObject object = EtcService.checkNeedSignWechatWithhold( contractOrder.getProductId() , contractOrder.getCardVarietyId()); |
||||
if (object.getString("errCode").equals("0")) { |
||||
return ResponseMsgUtil.success(object.getJSONObject("result")); |
||||
} else { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, object.getString("errMsg")); |
||||
} |
||||
|
||||
} else { |
||||
JSONObject object = EtcService.checkSignWithhold( contractOrder.getCustId()); |
||||
if (object.getString("errCode").equals("0")) { |
||||
if (object.getJSONObject("result").getBoolean("isSign")) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "已签约"); |
||||
} |
||||
} else { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, object.getString("errMsg")); |
||||
} |
||||
} |
||||
|
||||
return ResponseMsgUtil.success(true); |
||||
|
||||
} catch (Exception e) { |
||||
log.error("HighUserController --> findByUserId() error!", e); |
||||
return ResponseMsgUtil.exception(e); |
||||
} |
||||
} |
||||
|
||||
@RequestMapping(value = "/sendSignWithholdCode", method = RequestMethod.POST) |
||||
@ResponseBody |
||||
@ApiOperation(value = "签约银行卡代扣发送验证码") |
||||
public ResponseData sendSignWithholdCode(@RequestBody JSONObject object, HttpServletRequest request) { |
||||
try { |
||||
|
||||
if (object.getString("custId") == null || |
||||
object.getString("cardNo") == null || |
||||
object.getInteger("bankCardType") == null || |
||||
object.getString("mobileNo") == null) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "信息不全!"); |
||||
} |
||||
|
||||
if (object.getInteger("bankCardType") == 2 ) { |
||||
if (object.getString("cardExpired") == null || |
||||
object.getString("cardCvv2") == null ) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "信用卡信息不全!"); |
||||
} |
||||
} |
||||
|
||||
JSONObject jsonObject = EtcService.sendSignWithholdCode(object); |
||||
if (jsonObject.getString("errCode").equals("0")) { |
||||
|
||||
return ResponseMsgUtil.success(jsonObject.getJSONObject("result").getString("verifyCodeNo")); |
||||
} |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, jsonObject.getString("errMsg")); |
||||
|
||||
} catch (Exception e) { |
||||
log.error("HighUserController --> findByUserId() error!", e); |
||||
return ResponseMsgUtil.exception(e); |
||||
} |
||||
} |
||||
|
||||
@RequestMapping(value = "/signWithhold", method = RequestMethod.POST) |
||||
@ResponseBody |
||||
@ApiOperation(value = "签约银行卡代扣") |
||||
public ResponseData signWithhold(@RequestBody JSONObject object, HttpServletRequest request) { |
||||
try { |
||||
|
||||
if (object.getString("custId") == null || |
||||
object.getString("cardNo") == null || |
||||
object.getInteger("bankCardType") == null || |
||||
object.getString("bankName") == null || |
||||
object.getString("verifyCodeNo") == null || |
||||
object.getString("verifyCode") == null || |
||||
object.getString("mobileNo") == null) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "信息不全!"); |
||||
} |
||||
|
||||
if (object.getInteger("bankCardType") == 2 ) { |
||||
if (object.getString("cardExpired") == null || |
||||
object.getString("cardCvv2") == null ) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "信用卡信息不全!"); |
||||
} |
||||
} |
||||
|
||||
JSONObject jsonObject = EtcService.signWithhold(object); |
||||
if (jsonObject.getString("errCode").equals("0")) { |
||||
return ResponseMsgUtil.success("请求成功"); |
||||
} |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, jsonObject.getString("errMsg")); |
||||
|
||||
} catch (Exception e) { |
||||
log.error("HighUserController --> findByUserId() error!", e); |
||||
return ResponseMsgUtil.exception(e); |
||||
} |
||||
} |
||||
|
||||
|
||||
|
||||
|
||||
} |
@ -0,0 +1,158 @@ |
||||
package com.hai.dao; |
||||
|
||||
import com.hai.entity.EtcContractOrder; |
||||
import com.hai.entity.EtcContractOrderExample; |
||||
import java.util.List; |
||||
import org.apache.ibatis.annotations.Delete; |
||||
import org.apache.ibatis.annotations.DeleteProvider; |
||||
import org.apache.ibatis.annotations.Insert; |
||||
import org.apache.ibatis.annotations.InsertProvider; |
||||
import org.apache.ibatis.annotations.Options; |
||||
import org.apache.ibatis.annotations.Param; |
||||
import org.apache.ibatis.annotations.Result; |
||||
import org.apache.ibatis.annotations.Results; |
||||
import org.apache.ibatis.annotations.Select; |
||||
import org.apache.ibatis.annotations.SelectProvider; |
||||
import org.apache.ibatis.annotations.Update; |
||||
import org.apache.ibatis.annotations.UpdateProvider; |
||||
import org.apache.ibatis.type.JdbcType; |
||||
import org.springframework.stereotype.Repository; |
||||
|
||||
/** |
||||
* |
||||
* 代码由工具生成,请勿修改!!! |
||||
* 如果需要扩展请在其父类进行扩展 |
||||
* |
||||
**/ |
||||
@Repository |
||||
public interface EtcContractOrderMapper extends EtcContractOrderMapperExt { |
||||
@SelectProvider(type=EtcContractOrderSqlProvider.class, method="countByExample") |
||||
long countByExample(EtcContractOrderExample example); |
||||
|
||||
@DeleteProvider(type=EtcContractOrderSqlProvider.class, method="deleteByExample") |
||||
int deleteByExample(EtcContractOrderExample example); |
||||
|
||||
@Delete({ |
||||
"delete from etc_contract_order", |
||||
"where id = #{id,jdbcType=BIGINT}" |
||||
}) |
||||
int deleteByPrimaryKey(Long id); |
||||
|
||||
@Insert({ |
||||
"insert into etc_contract_order (phone, contract_no, ", |
||||
"cust_id, veh_id, product_id, ", |
||||
"card_variety_id, product_name, ", |
||||
"card_variety_name, sign_img, ", |
||||
"create_time, update_time, ", |
||||
"`status`, pay_status, ", |
||||
"sign_status, op_id, ", |
||||
"op_name, ext_1, ext_2, ", |
||||
"ext_3)", |
||||
"values (#{phone,jdbcType=VARCHAR}, #{contractNo,jdbcType=VARCHAR}, ", |
||||
"#{custId,jdbcType=VARCHAR}, #{vehId,jdbcType=VARCHAR}, #{productId,jdbcType=INTEGER}, ", |
||||
"#{cardVarietyId,jdbcType=INTEGER}, #{productName,jdbcType=VARCHAR}, ", |
||||
"#{cardVarietyName,jdbcType=VARCHAR}, #{signImg,jdbcType=VARCHAR}, ", |
||||
"#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, ", |
||||
"#{status,jdbcType=INTEGER}, #{payStatus,jdbcType=INTEGER}, ", |
||||
"#{signStatus,jdbcType=INTEGER}, #{opId,jdbcType=BIGINT}, ", |
||||
"#{opName,jdbcType=VARCHAR}, #{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, ", |
||||
"#{ext3,jdbcType=VARCHAR})" |
||||
}) |
||||
@Options(useGeneratedKeys=true,keyProperty="id") |
||||
int insert(EtcContractOrder record); |
||||
|
||||
@InsertProvider(type=EtcContractOrderSqlProvider.class, method="insertSelective") |
||||
@Options(useGeneratedKeys=true,keyProperty="id") |
||||
int insertSelective(EtcContractOrder record); |
||||
|
||||
@SelectProvider(type=EtcContractOrderSqlProvider.class, method="selectByExample") |
||||
@Results({ |
||||
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), |
||||
@Result(column="phone", property="phone", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="contract_no", property="contractNo", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="cust_id", property="custId", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="veh_id", property="vehId", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="product_id", property="productId", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="card_variety_id", property="cardVarietyId", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="product_name", property="productName", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="card_variety_name", property="cardVarietyName", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="sign_img", property="signImg", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), |
||||
@Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP), |
||||
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="pay_status", property="payStatus", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="sign_status", property="signStatus", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="op_id", property="opId", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="op_name", property="opName", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR) |
||||
}) |
||||
List<EtcContractOrder> selectByExample(EtcContractOrderExample example); |
||||
|
||||
@Select({ |
||||
"select", |
||||
"id, phone, contract_no, cust_id, veh_id, product_id, card_variety_id, product_name, ", |
||||
"card_variety_name, sign_img, create_time, update_time, `status`, pay_status, ", |
||||
"sign_status, op_id, op_name, ext_1, ext_2, ext_3", |
||||
"from etc_contract_order", |
||||
"where id = #{id,jdbcType=BIGINT}" |
||||
}) |
||||
@Results({ |
||||
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), |
||||
@Result(column="phone", property="phone", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="contract_no", property="contractNo", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="cust_id", property="custId", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="veh_id", property="vehId", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="product_id", property="productId", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="card_variety_id", property="cardVarietyId", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="product_name", property="productName", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="card_variety_name", property="cardVarietyName", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="sign_img", property="signImg", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), |
||||
@Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP), |
||||
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="pay_status", property="payStatus", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="sign_status", property="signStatus", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="op_id", property="opId", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="op_name", property="opName", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR) |
||||
}) |
||||
EtcContractOrder selectByPrimaryKey(Long id); |
||||
|
||||
@UpdateProvider(type=EtcContractOrderSqlProvider.class, method="updateByExampleSelective") |
||||
int updateByExampleSelective(@Param("record") EtcContractOrder record, @Param("example") EtcContractOrderExample example); |
||||
|
||||
@UpdateProvider(type=EtcContractOrderSqlProvider.class, method="updateByExample") |
||||
int updateByExample(@Param("record") EtcContractOrder record, @Param("example") EtcContractOrderExample example); |
||||
|
||||
@UpdateProvider(type=EtcContractOrderSqlProvider.class, method="updateByPrimaryKeySelective") |
||||
int updateByPrimaryKeySelective(EtcContractOrder record); |
||||
|
||||
@Update({ |
||||
"update etc_contract_order", |
||||
"set phone = #{phone,jdbcType=VARCHAR},", |
||||
"contract_no = #{contractNo,jdbcType=VARCHAR},", |
||||
"cust_id = #{custId,jdbcType=VARCHAR},", |
||||
"veh_id = #{vehId,jdbcType=VARCHAR},", |
||||
"product_id = #{productId,jdbcType=INTEGER},", |
||||
"card_variety_id = #{cardVarietyId,jdbcType=INTEGER},", |
||||
"product_name = #{productName,jdbcType=VARCHAR},", |
||||
"card_variety_name = #{cardVarietyName,jdbcType=VARCHAR},", |
||||
"sign_img = #{signImg,jdbcType=VARCHAR},", |
||||
"create_time = #{createTime,jdbcType=TIMESTAMP},", |
||||
"update_time = #{updateTime,jdbcType=TIMESTAMP},", |
||||
"`status` = #{status,jdbcType=INTEGER},", |
||||
"pay_status = #{payStatus,jdbcType=INTEGER},", |
||||
"sign_status = #{signStatus,jdbcType=INTEGER},", |
||||
"op_id = #{opId,jdbcType=BIGINT},", |
||||
"op_name = #{opName,jdbcType=VARCHAR},", |
||||
"ext_1 = #{ext1,jdbcType=VARCHAR},", |
||||
"ext_2 = #{ext2,jdbcType=VARCHAR},", |
||||
"ext_3 = #{ext3,jdbcType=VARCHAR}", |
||||
"where id = #{id,jdbcType=BIGINT}" |
||||
}) |
||||
int updateByPrimaryKey(EtcContractOrder record); |
||||
} |
@ -0,0 +1,7 @@ |
||||
package com.hai.dao; |
||||
|
||||
/** |
||||
* mapper扩展类 |
||||
*/ |
||||
public interface EtcContractOrderMapperExt { |
||||
} |
@ -0,0 +1,444 @@ |
||||
package com.hai.dao; |
||||
|
||||
import com.hai.entity.EtcContractOrder; |
||||
import com.hai.entity.EtcContractOrderExample.Criteria; |
||||
import com.hai.entity.EtcContractOrderExample.Criterion; |
||||
import com.hai.entity.EtcContractOrderExample; |
||||
import java.util.List; |
||||
import java.util.Map; |
||||
import org.apache.ibatis.jdbc.SQL; |
||||
|
||||
public class EtcContractOrderSqlProvider { |
||||
|
||||
public String countByExample(EtcContractOrderExample example) { |
||||
SQL sql = new SQL(); |
||||
sql.SELECT("count(*)").FROM("etc_contract_order"); |
||||
applyWhere(sql, example, false); |
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String deleteByExample(EtcContractOrderExample example) { |
||||
SQL sql = new SQL(); |
||||
sql.DELETE_FROM("etc_contract_order"); |
||||
applyWhere(sql, example, false); |
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String insertSelective(EtcContractOrder record) { |
||||
SQL sql = new SQL(); |
||||
sql.INSERT_INTO("etc_contract_order"); |
||||
|
||||
if (record.getPhone() != null) { |
||||
sql.VALUES("phone", "#{phone,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getContractNo() != null) { |
||||
sql.VALUES("contract_no", "#{contractNo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getCustId() != null) { |
||||
sql.VALUES("cust_id", "#{custId,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getVehId() != null) { |
||||
sql.VALUES("veh_id", "#{vehId,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getProductId() != null) { |
||||
sql.VALUES("product_id", "#{productId,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getCardVarietyId() != null) { |
||||
sql.VALUES("card_variety_id", "#{cardVarietyId,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getProductName() != null) { |
||||
sql.VALUES("product_name", "#{productName,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getCardVarietyName() != null) { |
||||
sql.VALUES("card_variety_name", "#{cardVarietyName,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getSignImg() != null) { |
||||
sql.VALUES("sign_img", "#{signImg,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getCreateTime() != null) { |
||||
sql.VALUES("create_time", "#{createTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getUpdateTime() != null) { |
||||
sql.VALUES("update_time", "#{updateTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getStatus() != null) { |
||||
sql.VALUES("`status`", "#{status,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getPayStatus() != null) { |
||||
sql.VALUES("pay_status", "#{payStatus,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getSignStatus() != null) { |
||||
sql.VALUES("sign_status", "#{signStatus,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getOpId() != null) { |
||||
sql.VALUES("op_id", "#{opId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getOpName() != null) { |
||||
sql.VALUES("op_name", "#{opName,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt1() != null) { |
||||
sql.VALUES("ext_1", "#{ext1,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt2() != null) { |
||||
sql.VALUES("ext_2", "#{ext2,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt3() != null) { |
||||
sql.VALUES("ext_3", "#{ext3,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String selectByExample(EtcContractOrderExample example) { |
||||
SQL sql = new SQL(); |
||||
if (example != null && example.isDistinct()) { |
||||
sql.SELECT_DISTINCT("id"); |
||||
} else { |
||||
sql.SELECT("id"); |
||||
} |
||||
sql.SELECT("phone"); |
||||
sql.SELECT("contract_no"); |
||||
sql.SELECT("cust_id"); |
||||
sql.SELECT("veh_id"); |
||||
sql.SELECT("product_id"); |
||||
sql.SELECT("card_variety_id"); |
||||
sql.SELECT("product_name"); |
||||
sql.SELECT("card_variety_name"); |
||||
sql.SELECT("sign_img"); |
||||
sql.SELECT("create_time"); |
||||
sql.SELECT("update_time"); |
||||
sql.SELECT("`status`"); |
||||
sql.SELECT("pay_status"); |
||||
sql.SELECT("sign_status"); |
||||
sql.SELECT("op_id"); |
||||
sql.SELECT("op_name"); |
||||
sql.SELECT("ext_1"); |
||||
sql.SELECT("ext_2"); |
||||
sql.SELECT("ext_3"); |
||||
sql.FROM("etc_contract_order"); |
||||
applyWhere(sql, example, false); |
||||
|
||||
if (example != null && example.getOrderByClause() != null) { |
||||
sql.ORDER_BY(example.getOrderByClause()); |
||||
} |
||||
|
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String updateByExampleSelective(Map<String, Object> parameter) { |
||||
EtcContractOrder record = (EtcContractOrder) parameter.get("record"); |
||||
EtcContractOrderExample example = (EtcContractOrderExample) parameter.get("example"); |
||||
|
||||
SQL sql = new SQL(); |
||||
sql.UPDATE("etc_contract_order"); |
||||
|
||||
if (record.getId() != null) { |
||||
sql.SET("id = #{record.id,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getPhone() != null) { |
||||
sql.SET("phone = #{record.phone,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getContractNo() != null) { |
||||
sql.SET("contract_no = #{record.contractNo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getCustId() != null) { |
||||
sql.SET("cust_id = #{record.custId,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getVehId() != null) { |
||||
sql.SET("veh_id = #{record.vehId,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getProductId() != null) { |
||||
sql.SET("product_id = #{record.productId,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getCardVarietyId() != null) { |
||||
sql.SET("card_variety_id = #{record.cardVarietyId,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getProductName() != null) { |
||||
sql.SET("product_name = #{record.productName,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getCardVarietyName() != null) { |
||||
sql.SET("card_variety_name = #{record.cardVarietyName,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getSignImg() != null) { |
||||
sql.SET("sign_img = #{record.signImg,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getCreateTime() != null) { |
||||
sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getUpdateTime() != null) { |
||||
sql.SET("update_time = #{record.updateTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getStatus() != null) { |
||||
sql.SET("`status` = #{record.status,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getPayStatus() != null) { |
||||
sql.SET("pay_status = #{record.payStatus,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getSignStatus() != null) { |
||||
sql.SET("sign_status = #{record.signStatus,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getOpId() != null) { |
||||
sql.SET("op_id = #{record.opId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getOpName() != null) { |
||||
sql.SET("op_name = #{record.opName,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt1() != null) { |
||||
sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt2() != null) { |
||||
sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt3() != null) { |
||||
sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
applyWhere(sql, example, true); |
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String updateByExample(Map<String, Object> parameter) { |
||||
SQL sql = new SQL(); |
||||
sql.UPDATE("etc_contract_order"); |
||||
|
||||
sql.SET("id = #{record.id,jdbcType=BIGINT}"); |
||||
sql.SET("phone = #{record.phone,jdbcType=VARCHAR}"); |
||||
sql.SET("contract_no = #{record.contractNo,jdbcType=VARCHAR}"); |
||||
sql.SET("cust_id = #{record.custId,jdbcType=VARCHAR}"); |
||||
sql.SET("veh_id = #{record.vehId,jdbcType=VARCHAR}"); |
||||
sql.SET("product_id = #{record.productId,jdbcType=INTEGER}"); |
||||
sql.SET("card_variety_id = #{record.cardVarietyId,jdbcType=INTEGER}"); |
||||
sql.SET("product_name = #{record.productName,jdbcType=VARCHAR}"); |
||||
sql.SET("card_variety_name = #{record.cardVarietyName,jdbcType=VARCHAR}"); |
||||
sql.SET("sign_img = #{record.signImg,jdbcType=VARCHAR}"); |
||||
sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}"); |
||||
sql.SET("update_time = #{record.updateTime,jdbcType=TIMESTAMP}"); |
||||
sql.SET("`status` = #{record.status,jdbcType=INTEGER}"); |
||||
sql.SET("pay_status = #{record.payStatus,jdbcType=INTEGER}"); |
||||
sql.SET("sign_status = #{record.signStatus,jdbcType=INTEGER}"); |
||||
sql.SET("op_id = #{record.opId,jdbcType=BIGINT}"); |
||||
sql.SET("op_name = #{record.opName,jdbcType=VARCHAR}"); |
||||
sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}"); |
||||
sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}"); |
||||
sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}"); |
||||
|
||||
EtcContractOrderExample example = (EtcContractOrderExample) parameter.get("example"); |
||||
applyWhere(sql, example, true); |
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String updateByPrimaryKeySelective(EtcContractOrder record) { |
||||
SQL sql = new SQL(); |
||||
sql.UPDATE("etc_contract_order"); |
||||
|
||||
if (record.getPhone() != null) { |
||||
sql.SET("phone = #{phone,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getContractNo() != null) { |
||||
sql.SET("contract_no = #{contractNo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getCustId() != null) { |
||||
sql.SET("cust_id = #{custId,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getVehId() != null) { |
||||
sql.SET("veh_id = #{vehId,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getProductId() != null) { |
||||
sql.SET("product_id = #{productId,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getCardVarietyId() != null) { |
||||
sql.SET("card_variety_id = #{cardVarietyId,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getProductName() != null) { |
||||
sql.SET("product_name = #{productName,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getCardVarietyName() != null) { |
||||
sql.SET("card_variety_name = #{cardVarietyName,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getSignImg() != null) { |
||||
sql.SET("sign_img = #{signImg,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getCreateTime() != null) { |
||||
sql.SET("create_time = #{createTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getUpdateTime() != null) { |
||||
sql.SET("update_time = #{updateTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getStatus() != null) { |
||||
sql.SET("`status` = #{status,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getPayStatus() != null) { |
||||
sql.SET("pay_status = #{payStatus,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getSignStatus() != null) { |
||||
sql.SET("sign_status = #{signStatus,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getOpId() != null) { |
||||
sql.SET("op_id = #{opId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getOpName() != null) { |
||||
sql.SET("op_name = #{opName,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt1() != null) { |
||||
sql.SET("ext_1 = #{ext1,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt2() != null) { |
||||
sql.SET("ext_2 = #{ext2,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt3() != null) { |
||||
sql.SET("ext_3 = #{ext3,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
sql.WHERE("id = #{id,jdbcType=BIGINT}"); |
||||
|
||||
return sql.toString(); |
||||
} |
||||
|
||||
protected void applyWhere(SQL sql, EtcContractOrderExample example, boolean includeExamplePhrase) { |
||||
if (example == null) { |
||||
return; |
||||
} |
||||
|
||||
String parmPhrase1; |
||||
String parmPhrase1_th; |
||||
String parmPhrase2; |
||||
String parmPhrase2_th; |
||||
String parmPhrase3; |
||||
String parmPhrase3_th; |
||||
if (includeExamplePhrase) { |
||||
parmPhrase1 = "%s #{example.oredCriteria[%d].allCriteria[%d].value}"; |
||||
parmPhrase1_th = "%s #{example.oredCriteria[%d].allCriteria[%d].value,typeHandler=%s}"; |
||||
parmPhrase2 = "%s #{example.oredCriteria[%d].allCriteria[%d].value} and #{example.oredCriteria[%d].criteria[%d].secondValue}"; |
||||
parmPhrase2_th = "%s #{example.oredCriteria[%d].allCriteria[%d].value,typeHandler=%s} and #{example.oredCriteria[%d].criteria[%d].secondValue,typeHandler=%s}"; |
||||
parmPhrase3 = "#{example.oredCriteria[%d].allCriteria[%d].value[%d]}"; |
||||
parmPhrase3_th = "#{example.oredCriteria[%d].allCriteria[%d].value[%d],typeHandler=%s}"; |
||||
} else { |
||||
parmPhrase1 = "%s #{oredCriteria[%d].allCriteria[%d].value}"; |
||||
parmPhrase1_th = "%s #{oredCriteria[%d].allCriteria[%d].value,typeHandler=%s}"; |
||||
parmPhrase2 = "%s #{oredCriteria[%d].allCriteria[%d].value} and #{oredCriteria[%d].criteria[%d].secondValue}"; |
||||
parmPhrase2_th = "%s #{oredCriteria[%d].allCriteria[%d].value,typeHandler=%s} and #{oredCriteria[%d].criteria[%d].secondValue,typeHandler=%s}"; |
||||
parmPhrase3 = "#{oredCriteria[%d].allCriteria[%d].value[%d]}"; |
||||
parmPhrase3_th = "#{oredCriteria[%d].allCriteria[%d].value[%d],typeHandler=%s}"; |
||||
} |
||||
|
||||
StringBuilder sb = new StringBuilder(); |
||||
List<Criteria> oredCriteria = example.getOredCriteria(); |
||||
boolean firstCriteria = true; |
||||
for (int i = 0; i < oredCriteria.size(); i++) { |
||||
Criteria criteria = oredCriteria.get(i); |
||||
if (criteria.isValid()) { |
||||
if (firstCriteria) { |
||||
firstCriteria = false; |
||||
} else { |
||||
sb.append(" or "); |
||||
} |
||||
|
||||
sb.append('('); |
||||
List<Criterion> criterions = criteria.getAllCriteria(); |
||||
boolean firstCriterion = true; |
||||
for (int j = 0; j < criterions.size(); j++) { |
||||
Criterion criterion = criterions.get(j); |
||||
if (firstCriterion) { |
||||
firstCriterion = false; |
||||
} else { |
||||
sb.append(" and "); |
||||
} |
||||
|
||||
if (criterion.isNoValue()) { |
||||
sb.append(criterion.getCondition()); |
||||
} else if (criterion.isSingleValue()) { |
||||
if (criterion.getTypeHandler() == null) { |
||||
sb.append(String.format(parmPhrase1, criterion.getCondition(), i, j)); |
||||
} else { |
||||
sb.append(String.format(parmPhrase1_th, criterion.getCondition(), i, j,criterion.getTypeHandler())); |
||||
} |
||||
} else if (criterion.isBetweenValue()) { |
||||
if (criterion.getTypeHandler() == null) { |
||||
sb.append(String.format(parmPhrase2, criterion.getCondition(), i, j, i, j)); |
||||
} else { |
||||
sb.append(String.format(parmPhrase2_th, criterion.getCondition(), i, j, criterion.getTypeHandler(), i, j, criterion.getTypeHandler())); |
||||
} |
||||
} else if (criterion.isListValue()) { |
||||
sb.append(criterion.getCondition()); |
||||
sb.append(" ("); |
||||
List<?> listItems = (List<?>) criterion.getValue(); |
||||
boolean comma = false; |
||||
for (int k = 0; k < listItems.size(); k++) { |
||||
if (comma) { |
||||
sb.append(", "); |
||||
} else { |
||||
comma = true; |
||||
} |
||||
if (criterion.getTypeHandler() == null) { |
||||
sb.append(String.format(parmPhrase3, i, j, k)); |
||||
} else { |
||||
sb.append(String.format(parmPhrase3_th, i, j, k, criterion.getTypeHandler())); |
||||
} |
||||
} |
||||
sb.append(')'); |
||||
} |
||||
} |
||||
sb.append(')'); |
||||
} |
||||
} |
||||
|
||||
if (sb.length() > 0) { |
||||
sql.WHERE(sb.toString()); |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,369 @@ |
||||
package com.hai.entity; |
||||
|
||||
import java.io.Serializable; |
||||
import java.util.Date; |
||||
|
||||
/** |
||||
* etc_contract_order |
||||
* @author |
||||
*/ |
||||
/** |
||||
* |
||||
* 代码由工具生成 |
||||
* |
||||
**/ |
||||
public class EtcContractOrder implements Serializable { |
||||
/** |
||||
* 主键 |
||||
*/ |
||||
private Long id; |
||||
|
||||
/** |
||||
* 客户手机号码 |
||||
*/ |
||||
private String phone; |
||||
|
||||
/** |
||||
* 合同编码 |
||||
*/ |
||||
private String contractNo; |
||||
|
||||
/** |
||||
* 用户信息ID |
||||
*/ |
||||
private String custId; |
||||
|
||||
/** |
||||
* 车辆id |
||||
*/ |
||||
private String vehId; |
||||
|
||||
/** |
||||
* 产品id |
||||
*/ |
||||
private Integer productId; |
||||
|
||||
/** |
||||
* 卡种id |
||||
*/ |
||||
private Integer cardVarietyId; |
||||
|
||||
/** |
||||
* 产品名称 |
||||
*/ |
||||
private String productName; |
||||
|
||||
/** |
||||
* 卡种 |
||||
*/ |
||||
private String cardVarietyName; |
||||
|
||||
/** |
||||
* 签名图片 |
||||
*/ |
||||
private String signImg; |
||||
|
||||
/** |
||||
* 创建时间 |
||||
*/ |
||||
private Date createTime; |
||||
|
||||
/** |
||||
* 更新时间 |
||||
*/ |
||||
private Date updateTime; |
||||
|
||||
/** |
||||
* 状态 0 删除 1:正常 |
||||
*/ |
||||
private Integer status; |
||||
|
||||
/** |
||||
* 支付状态:1:未支付,2:已支付 |
||||
*/ |
||||
private Integer payStatus; |
||||
|
||||
/** |
||||
* 签约状态:1已签约, 0:未签约 |
||||
*/ |
||||
private Integer signStatus; |
||||
|
||||
/** |
||||
* 操作人 |
||||
*/ |
||||
private Long opId; |
||||
|
||||
/** |
||||
* 操作人名称 |
||||
*/ |
||||
private String opName; |
||||
|
||||
/** |
||||
* ext_1 |
||||
*/ |
||||
private String ext1; |
||||
|
||||
/** |
||||
* ext_2 |
||||
*/ |
||||
private String ext2; |
||||
|
||||
/** |
||||
* ext_3 |
||||
*/ |
||||
private String ext3; |
||||
|
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
public Long getId() { |
||||
return id; |
||||
} |
||||
|
||||
public void setId(Long id) { |
||||
this.id = id; |
||||
} |
||||
|
||||
public String getPhone() { |
||||
return phone; |
||||
} |
||||
|
||||
public void setPhone(String phone) { |
||||
this.phone = phone; |
||||
} |
||||
|
||||
public String getContractNo() { |
||||
return contractNo; |
||||
} |
||||
|
||||
public void setContractNo(String contractNo) { |
||||
this.contractNo = contractNo; |
||||
} |
||||
|
||||
public String getCustId() { |
||||
return custId; |
||||
} |
||||
|
||||
public void setCustId(String custId) { |
||||
this.custId = custId; |
||||
} |
||||
|
||||
public String getVehId() { |
||||
return vehId; |
||||
} |
||||
|
||||
public void setVehId(String vehId) { |
||||
this.vehId = vehId; |
||||
} |
||||
|
||||
public Integer getProductId() { |
||||
return productId; |
||||
} |
||||
|
||||
public void setProductId(Integer productId) { |
||||
this.productId = productId; |
||||
} |
||||
|
||||
public Integer getCardVarietyId() { |
||||
return cardVarietyId; |
||||
} |
||||
|
||||
public void setCardVarietyId(Integer cardVarietyId) { |
||||
this.cardVarietyId = cardVarietyId; |
||||
} |
||||
|
||||
public String getProductName() { |
||||
return productName; |
||||
} |
||||
|
||||
public void setProductName(String productName) { |
||||
this.productName = productName; |
||||
} |
||||
|
||||
public String getCardVarietyName() { |
||||
return cardVarietyName; |
||||
} |
||||
|
||||
public void setCardVarietyName(String cardVarietyName) { |
||||
this.cardVarietyName = cardVarietyName; |
||||
} |
||||
|
||||
public String getSignImg() { |
||||
return signImg; |
||||
} |
||||
|
||||
public void setSignImg(String signImg) { |
||||
this.signImg = signImg; |
||||
} |
||||
|
||||
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 getStatus() { |
||||
return status; |
||||
} |
||||
|
||||
public void setStatus(Integer status) { |
||||
this.status = status; |
||||
} |
||||
|
||||
public Integer getPayStatus() { |
||||
return payStatus; |
||||
} |
||||
|
||||
public void setPayStatus(Integer payStatus) { |
||||
this.payStatus = payStatus; |
||||
} |
||||
|
||||
public Integer getSignStatus() { |
||||
return signStatus; |
||||
} |
||||
|
||||
public void setSignStatus(Integer signStatus) { |
||||
this.signStatus = signStatus; |
||||
} |
||||
|
||||
public Long getOpId() { |
||||
return opId; |
||||
} |
||||
|
||||
public void setOpId(Long opId) { |
||||
this.opId = opId; |
||||
} |
||||
|
||||
public String getOpName() { |
||||
return opName; |
||||
} |
||||
|
||||
public void setOpName(String opName) { |
||||
this.opName = opName; |
||||
} |
||||
|
||||
public String getExt1() { |
||||
return ext1; |
||||
} |
||||
|
||||
public void setExt1(String ext1) { |
||||
this.ext1 = ext1; |
||||
} |
||||
|
||||
public String getExt2() { |
||||
return ext2; |
||||
} |
||||
|
||||
public void setExt2(String ext2) { |
||||
this.ext2 = ext2; |
||||
} |
||||
|
||||
public String getExt3() { |
||||
return ext3; |
||||
} |
||||
|
||||
public void setExt3(String ext3) { |
||||
this.ext3 = ext3; |
||||
} |
||||
|
||||
@Override |
||||
public boolean equals(Object that) { |
||||
if (this == that) { |
||||
return true; |
||||
} |
||||
if (that == null) { |
||||
return false; |
||||
} |
||||
if (getClass() != that.getClass()) { |
||||
return false; |
||||
} |
||||
EtcContractOrder other = (EtcContractOrder) that; |
||||
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) |
||||
&& (this.getPhone() == null ? other.getPhone() == null : this.getPhone().equals(other.getPhone())) |
||||
&& (this.getContractNo() == null ? other.getContractNo() == null : this.getContractNo().equals(other.getContractNo())) |
||||
&& (this.getCustId() == null ? other.getCustId() == null : this.getCustId().equals(other.getCustId())) |
||||
&& (this.getVehId() == null ? other.getVehId() == null : this.getVehId().equals(other.getVehId())) |
||||
&& (this.getProductId() == null ? other.getProductId() == null : this.getProductId().equals(other.getProductId())) |
||||
&& (this.getCardVarietyId() == null ? other.getCardVarietyId() == null : this.getCardVarietyId().equals(other.getCardVarietyId())) |
||||
&& (this.getProductName() == null ? other.getProductName() == null : this.getProductName().equals(other.getProductName())) |
||||
&& (this.getCardVarietyName() == null ? other.getCardVarietyName() == null : this.getCardVarietyName().equals(other.getCardVarietyName())) |
||||
&& (this.getSignImg() == null ? other.getSignImg() == null : this.getSignImg().equals(other.getSignImg())) |
||||
&& (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime())) |
||||
&& (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime())) |
||||
&& (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus())) |
||||
&& (this.getPayStatus() == null ? other.getPayStatus() == null : this.getPayStatus().equals(other.getPayStatus())) |
||||
&& (this.getSignStatus() == null ? other.getSignStatus() == null : this.getSignStatus().equals(other.getSignStatus())) |
||||
&& (this.getOpId() == null ? other.getOpId() == null : this.getOpId().equals(other.getOpId())) |
||||
&& (this.getOpName() == null ? other.getOpName() == null : this.getOpName().equals(other.getOpName())) |
||||
&& (this.getExt1() == null ? other.getExt1() == null : this.getExt1().equals(other.getExt1())) |
||||
&& (this.getExt2() == null ? other.getExt2() == null : this.getExt2().equals(other.getExt2())) |
||||
&& (this.getExt3() == null ? other.getExt3() == null : this.getExt3().equals(other.getExt3())); |
||||
} |
||||
|
||||
@Override |
||||
public int hashCode() { |
||||
final int prime = 31; |
||||
int result = 1; |
||||
result = prime * result + ((getId() == null) ? 0 : getId().hashCode()); |
||||
result = prime * result + ((getPhone() == null) ? 0 : getPhone().hashCode()); |
||||
result = prime * result + ((getContractNo() == null) ? 0 : getContractNo().hashCode()); |
||||
result = prime * result + ((getCustId() == null) ? 0 : getCustId().hashCode()); |
||||
result = prime * result + ((getVehId() == null) ? 0 : getVehId().hashCode()); |
||||
result = prime * result + ((getProductId() == null) ? 0 : getProductId().hashCode()); |
||||
result = prime * result + ((getCardVarietyId() == null) ? 0 : getCardVarietyId().hashCode()); |
||||
result = prime * result + ((getProductName() == null) ? 0 : getProductName().hashCode()); |
||||
result = prime * result + ((getCardVarietyName() == null) ? 0 : getCardVarietyName().hashCode()); |
||||
result = prime * result + ((getSignImg() == null) ? 0 : getSignImg().hashCode()); |
||||
result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode()); |
||||
result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode()); |
||||
result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode()); |
||||
result = prime * result + ((getPayStatus() == null) ? 0 : getPayStatus().hashCode()); |
||||
result = prime * result + ((getSignStatus() == null) ? 0 : getSignStatus().hashCode()); |
||||
result = prime * result + ((getOpId() == null) ? 0 : getOpId().hashCode()); |
||||
result = prime * result + ((getOpName() == null) ? 0 : getOpName().hashCode()); |
||||
result = prime * result + ((getExt1() == null) ? 0 : getExt1().hashCode()); |
||||
result = prime * result + ((getExt2() == null) ? 0 : getExt2().hashCode()); |
||||
result = prime * result + ((getExt3() == null) ? 0 : getExt3().hashCode()); |
||||
return result; |
||||
} |
||||
|
||||
@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(", phone=").append(phone); |
||||
sb.append(", contractNo=").append(contractNo); |
||||
sb.append(", custId=").append(custId); |
||||
sb.append(", vehId=").append(vehId); |
||||
sb.append(", productId=").append(productId); |
||||
sb.append(", cardVarietyId=").append(cardVarietyId); |
||||
sb.append(", productName=").append(productName); |
||||
sb.append(", cardVarietyName=").append(cardVarietyName); |
||||
sb.append(", signImg=").append(signImg); |
||||
sb.append(", createTime=").append(createTime); |
||||
sb.append(", updateTime=").append(updateTime); |
||||
sb.append(", status=").append(status); |
||||
sb.append(", payStatus=").append(payStatus); |
||||
sb.append(", signStatus=").append(signStatus); |
||||
sb.append(", opId=").append(opId); |
||||
sb.append(", opName=").append(opName); |
||||
sb.append(", ext1=").append(ext1); |
||||
sb.append(", ext2=").append(ext2); |
||||
sb.append(", ext3=").append(ext3); |
||||
sb.append(", serialVersionUID=").append(serialVersionUID); |
||||
sb.append("]"); |
||||
return sb.toString(); |
||||
} |
||||
} |
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,45 @@ |
||||
package com.hai.enum_type; |
||||
|
||||
import java.util.Objects; |
||||
|
||||
public enum EtcProductEnum { |
||||
productName23(23, "e信通" ), |
||||
productName26(26, "e达通" ), |
||||
productName45(45, "阳光行S" ), |
||||
|
||||
; |
||||
|
||||
private Integer number; |
||||
|
||||
private String name; |
||||
|
||||
|
||||
EtcProductEnum(int number, String name) { |
||||
this.number = number; |
||||
this.name = name; |
||||
|
||||
} |
||||
|
||||
public static String getNameByType(Integer type) { |
||||
for (EtcProductEnum ele : values()) { |
||||
if (Objects.equals(type,ele.getNumber())) { |
||||
return ele.getName(); |
||||
} |
||||
} |
||||
return null; |
||||
} |
||||
|
||||
public Integer getNumber() { |
||||
return number; |
||||
} |
||||
|
||||
public void setNumber(Integer number) { |
||||
this.number = number; |
||||
} |
||||
|
||||
public String getName() { |
||||
return name; |
||||
} |
||||
|
||||
|
||||
} |
@ -0,0 +1,43 @@ |
||||
package com.hai.enum_type; |
||||
|
||||
import java.util.Objects; |
||||
|
||||
public enum EtcVarietyEnum { |
||||
varietyName2(2, "龙通卡" ), |
||||
varietyName6(6, "九州卡" ), |
||||
; |
||||
|
||||
private Integer number; |
||||
|
||||
private String name; |
||||
|
||||
|
||||
EtcVarietyEnum(int number, String name) { |
||||
this.number = number; |
||||
this.name = name; |
||||
|
||||
} |
||||
|
||||
public static String getNameByType(Integer type) { |
||||
for (EtcVarietyEnum ele : values()) { |
||||
if (Objects.equals(type,ele.getNumber())) { |
||||
return ele.getName(); |
||||
} |
||||
} |
||||
return null; |
||||
} |
||||
|
||||
public Integer getNumber() { |
||||
return number; |
||||
} |
||||
|
||||
public void setNumber(Integer number) { |
||||
this.number = number; |
||||
} |
||||
|
||||
public String getName() { |
||||
return name; |
||||
} |
||||
|
||||
|
||||
} |
Loading…
Reference in new issue