| @@ -0,0 +1,85 @@ | |||
| package com.iformall.controller.market; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.annotation.SystemControllerLog; | |||
| import com.iformall.common.Result; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.controller.base.BaseController; | |||
| import com.iformall.domain.po.BaseEntity; | |||
| import com.iformall.domain.po.WxMerchantPowerBillConfig; | |||
| import com.iformall.service.WxMerchantPowerBillConfigService; | |||
| import io.swagger.annotations.Api; | |||
| import io.swagger.annotations.ApiImplicitParam; | |||
| import io.swagger.annotations.ApiImplicitParams; | |||
| import io.swagger.annotations.ApiOperation; | |||
| import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.web.bind.annotation.*; | |||
| /** | |||
| * @author gongbiao | |||
| */ | |||
| @RestController | |||
| @RequestMapping("WxMerchantPowerBillConfig") | |||
| @Api(description = "商户电费生成配置") | |||
| public class WxMerchantPowerBillConfigController extends BaseController { | |||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||
| @Autowired | |||
| private WxMerchantPowerBillConfigService wxMerchantPowerBillConfigService; | |||
| @ApiOperation("查询数据列表") | |||
| @GetMapping("/list") | |||
| @SystemControllerLog(description = "查询数据列表") | |||
| @ApiImplicitParams({ | |||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | |||
| public ResultData findCouponDataList(@ModelAttribute WxMerchantPowerBillConfig wxMerchantPowerBillConfig, Integer pageNum, Integer pageSize) { | |||
| logger.debug("[" + getIpAddr() + "] WxMerchantPowerBillConfigController::list"); | |||
| wxMerchantPowerBillConfig.setTenantId(getTenantId()); | |||
| wxMerchantPowerBillConfig.setSortColumns(BaseEntity.SortField.CreateDate_DESC); | |||
| final PageInfo<WxMerchantPowerBillConfig> page = wxMerchantPowerBillConfigService.listAsPage(wxMerchantPowerBillConfig, pageNum, pageSize); | |||
| return new ResultData(page); | |||
| } | |||
| @ApiOperation("新增") | |||
| @PostMapping("add") | |||
| @SystemControllerLog(description = "新增") | |||
| public ResultData add(@RequestBody WxMerchantPowerBillConfig wxMerchantPowerBillConfig) { | |||
| logger.debug("[" + getIpAddr() + "] WxMerchantPowerBillConfigController::add"); | |||
| return wxMerchantPowerBillConfigService.saveOrUpdate(wxMerchantPowerBillConfig); | |||
| } | |||
| @ApiOperation("更新") | |||
| @PostMapping("update") | |||
| @SystemControllerLog(description = "更新") | |||
| public ResultData update(@RequestBody WxMerchantPowerBillConfig wxMerchantPowerBillConfig) { | |||
| logger.debug("[" + getIpAddr() + "] WxMerchantPowerBillConfigController::update"); | |||
| return wxMerchantPowerBillConfigService.saveOrUpdate(wxMerchantPowerBillConfig); | |||
| } | |||
| @ApiOperation("删除") | |||
| @GetMapping("/del") | |||
| @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | |||
| @SystemControllerLog(description = "删除") | |||
| public ResultData delete(Long id) { | |||
| logger.debug("[" + getIpAddr() + "] WxMerchantPowerBillConfigController::delete"); | |||
| wxMerchantPowerBillConfigService.deleteById(id); | |||
| return new ResultData(Result.SUCCESS, "删除成功", null); | |||
| } | |||
| @ApiOperation("根据id查询接口") | |||
| @GetMapping("/findById") | |||
| @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | |||
| @SystemControllerLog(description = "id查询") | |||
| public ResultData findById(Long id) { | |||
| logger.debug("[" + getIpAddr() + "] WxMerchantPowerBillConfigController::findById"); | |||
| return new ResultData(Result.SUCCESS, "查询成功", wxMerchantPowerBillConfigService.getById(id)); | |||
| } | |||
| } | |||
| @@ -0,0 +1,68 @@ | |||
| package com.iformall.controller.market; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.annotation.SystemControllerLog; | |||
| import com.iformall.common.Result; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.controller.base.BaseController; | |||
| import com.iformall.domain.po.BaseEntity; | |||
| import com.iformall.domain.po.WxMerchantPowerBillConfig; | |||
| import com.iformall.domain.po.WxPowerBillAutoConfig; | |||
| import com.iformall.service.WxPowerBillAutoConfigService; | |||
| import io.swagger.annotations.Api; | |||
| import io.swagger.annotations.ApiImplicitParam; | |||
| import io.swagger.annotations.ApiImplicitParams; | |||
| import io.swagger.annotations.ApiOperation; | |||
| import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.web.bind.annotation.*; | |||
| /** | |||
| * @author gongbiao | |||
| */ | |||
| @RestController | |||
| @RequestMapping("WxMerchantPowerBillConfig") | |||
| @Api(description = "电费自动生成配置") | |||
| public class WxPowerBillAutoConfigController extends BaseController { | |||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||
| @Autowired | |||
| private WxPowerBillAutoConfigService wxPowerBillAutoConfigService; | |||
| @ApiOperation("查询数据列表") | |||
| @GetMapping("/list") | |||
| @SystemControllerLog(description = "查询数据列表") | |||
| @ApiImplicitParams({ | |||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | |||
| public ResultData findCouponDataList(@ModelAttribute WxPowerBillAutoConfig wxPowerBillAutoConfig, Integer pageNum, Integer pageSize) { | |||
| logger.debug("[" + getIpAddr() + "] WxPowerBillAutoConfigController::list"); | |||
| wxPowerBillAutoConfig.setTenantId(getTenantId()); | |||
| wxPowerBillAutoConfig.setSortColumns(BaseEntity.SortField.CreateDate_DESC); | |||
| final PageInfo<WxPowerBillAutoConfig> page = wxPowerBillAutoConfigService.listAsPage(wxPowerBillAutoConfig, pageNum, pageSize); | |||
| return new ResultData(page); | |||
| } | |||
| @ApiOperation("修改") | |||
| @PostMapping("modify") | |||
| @SystemControllerLog(description = "新增") | |||
| public ResultData add(@RequestBody WxPowerBillAutoConfig wxPowerBillAutoConfig) { | |||
| logger.debug("[" + getIpAddr() + "] WxPowerBillAutoConfigController::modify"); | |||
| return wxPowerBillAutoConfigService.modify(wxPowerBillAutoConfig); | |||
| } | |||
| @ApiOperation("得到配置信息") | |||
| @GetMapping("/getConfig") | |||
| @SystemControllerLog(description = "id查询") | |||
| public ResultData getConfig() { | |||
| logger.debug("[" + getIpAddr() + "] WxPowerBillAutoConfigController::getConfig"); | |||
| return new ResultData(Result.SUCCESS, "查询成功", wxPowerBillAutoConfigService.getConfig(getTenantId())); | |||
| } | |||
| } | |||
| @@ -0,0 +1,50 @@ | |||
| package com.iformall.domain.po; | |||
| import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | |||
| import lombok.Data; | |||
| import lombok.EqualsAndHashCode; | |||
| import javax.persistence.Id; | |||
| import javax.persistence.Table; | |||
| import javax.persistence.Transient; | |||
| import java.util.Date; | |||
| import java.util.List; | |||
| /** | |||
| * @author gongbiao | |||
| */ | |||
| @Table(name = "wx_merchant_power_bill_config") | |||
| @Data | |||
| @JsonIgnoreProperties(value = {"handler"}) | |||
| @EqualsAndHashCode(callSuper = true) | |||
| public class WxMerchantPowerBillConfig extends BaseEntity { | |||
| @Id | |||
| protected Long id; | |||
| @Transient | |||
| protected List<Long> ids; | |||
| @io.swagger.annotations.ApiModelProperty(value = "tenantId", name = "tenantId") | |||
| private String tenantId; | |||
| @io.swagger.annotations.ApiModelProperty(value = "'商户ID'", name = "merchantId") | |||
| private Long merchantId; | |||
| @io.swagger.annotations.ApiModelProperty(value = "'商户名称'", name = "merchantName") | |||
| private String merchantName; | |||
| @io.swagger.annotations.ApiModelProperty(value = "'商户类型'", name = "merchantType") | |||
| private Integer merchantType; | |||
| @io.swagger.annotations.ApiModelProperty(value = "生成方式1按电表2固定金额", name = "buildWay") | |||
| private Integer buildWay; | |||
| @io.swagger.annotations.ApiModelProperty(value = "金额(电表计费时为单价)", name = "price") | |||
| private String price; | |||
| @io.swagger.annotations.ApiModelProperty(value = "创建时间", name = "createTime") | |||
| private Date createDate; | |||
| @io.swagger.annotations.ApiModelProperty(value = "修改时间", name = "updateTime") | |||
| private Date updateDate; | |||
| } | |||
| @@ -0,0 +1,44 @@ | |||
| package com.iformall.domain.po; | |||
| import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | |||
| import lombok.Data; | |||
| import lombok.EqualsAndHashCode; | |||
| import javax.persistence.Id; | |||
| import javax.persistence.Table; | |||
| import javax.persistence.Transient; | |||
| import java.util.Date; | |||
| import java.util.List; | |||
| /** | |||
| * @author gongbiao | |||
| */ | |||
| @Table(name = "wx_power_bill_auto_config") | |||
| @Data | |||
| @JsonIgnoreProperties(value = {"handler"}) | |||
| @EqualsAndHashCode(callSuper = true) | |||
| public class WxPowerBillAutoConfig extends BaseEntity { | |||
| @Id | |||
| protected Long id; | |||
| @Transient | |||
| protected List<Long> ids; | |||
| @io.swagger.annotations.ApiModelProperty(value = "tenantId", name = "tenantId") | |||
| private String tenantId; | |||
| @io.swagger.annotations.ApiModelProperty(value = "'单价'", name = "unitPrice") | |||
| private String unitPrice; | |||
| @io.swagger.annotations.ApiModelProperty(value = "'每月多少日拉取上月数据'", name = "buildDay") | |||
| private String buildDay; | |||
| @io.swagger.annotations.ApiModelProperty(value = "截止缴款日", name = "receiveDay") | |||
| private String receiveDay; | |||
| @io.swagger.annotations.ApiModelProperty(value = "创建时间", name = "createTime") | |||
| private Date createDate; | |||
| @io.swagger.annotations.ApiModelProperty(value = "修改时间", name = "updateTime") | |||
| private Date updateDate; | |||
| } | |||
| @@ -0,0 +1,12 @@ | |||
| package com.iformall.mapper; | |||
| import com.iformall.common.CommonMapper; | |||
| import com.iformall.domain.po.WxMerchantPowerBillConfig; | |||
| import java.util.List; | |||
| public interface WxMerchantPowerBillConfigMapper extends CommonMapper<WxMerchantPowerBillConfig, Long> { | |||
| List<WxMerchantPowerBillConfig> findList(WxMerchantPowerBillConfig wxMerchantPowerBillConfig); | |||
| } | |||
| @@ -0,0 +1,12 @@ | |||
| package com.iformall.mapper; | |||
| import com.iformall.common.CommonMapper; | |||
| import com.iformall.domain.po.WxPowerBillAutoConfig; | |||
| import java.util.List; | |||
| public interface WxPowerBillAutoConfigMapper extends CommonMapper<WxPowerBillAutoConfig, Long> { | |||
| List<WxPowerBillAutoConfig> findList(WxPowerBillAutoConfig wxPowerBillAutoConfig); | |||
| } | |||
| @@ -0,0 +1,43 @@ | |||
| package com.iformall.service; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.domain.po.WxMerchantPowerBillConfig; | |||
| public interface WxMerchantPowerBillConfigService { | |||
| /** | |||
| * 根据实体查询分页列表 | |||
| * | |||
| * @param record | |||
| * @param pageIndex | |||
| * @param pageSize | |||
| * @return | |||
| */ | |||
| PageInfo<WxMerchantPowerBillConfig> listAsPage(WxMerchantPowerBillConfig record, Integer pageIndex, Integer pageSize); | |||
| /** | |||
| * 根据Id获得实体 | |||
| * | |||
| * @param id | |||
| * @return | |||
| */ | |||
| WxMerchantPowerBillConfig getById(Long id); | |||
| /** | |||
| * 保存或更新实体 | |||
| * | |||
| * @param record | |||
| */ | |||
| ResultData saveOrUpdate(WxMerchantPowerBillConfig record); | |||
| /** | |||
| * 根据Id删除实体 | |||
| * | |||
| * @param id | |||
| */ | |||
| void deleteById(Long id); | |||
| } | |||
| @@ -0,0 +1,38 @@ | |||
| package com.iformall.service; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.domain.po.WxPowerBillAutoConfig; | |||
| /** | |||
| * @author gongbiao | |||
| */ | |||
| public interface WxPowerBillAutoConfigService { | |||
| /** | |||
| * 根据实体查询分页列表 | |||
| * | |||
| * @param record | |||
| * @param pageIndex | |||
| * @param pageSize | |||
| * @return | |||
| */ | |||
| PageInfo<WxPowerBillAutoConfig> listAsPage(WxPowerBillAutoConfig record, Integer pageIndex, Integer pageSize); | |||
| /** | |||
| * 根据tenantId获得实体 | |||
| * | |||
| * @param tenantId | |||
| * @return | |||
| */ | |||
| WxPowerBillAutoConfig getConfig(String tenantId); | |||
| /** | |||
| * 保存或更新实体 | |||
| * | |||
| * @param record | |||
| */ | |||
| ResultData modify(WxPowerBillAutoConfig record); | |||
| } | |||
| @@ -0,0 +1,77 @@ | |||
| package com.iformall.service.impl; | |||
| import com.github.pagehelper.PageHelper; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.common.ErrorCode; | |||
| import com.iformall.common.IdWorker; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.domain.po.WxMerchant; | |||
| import com.iformall.domain.po.WxMerchantPowerBillConfig; | |||
| import com.iformall.mapper.WxMerchantMapper; | |||
| import com.iformall.mapper.WxMerchantPowerBillConfigMapper; | |||
| import com.iformall.service.WxMerchantPowerBillConfigService; | |||
| import lombok.extern.slf4j.Slf4j; | |||
| import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.stereotype.Service; | |||
| import org.springframework.transaction.annotation.Propagation; | |||
| import org.springframework.transaction.annotation.Transactional; | |||
| import java.util.Date; | |||
| /** | |||
| * @author gongbiao | |||
| */ | |||
| @Service | |||
| @Slf4j | |||
| public class WxMerchantPowerBillConfigServiceImpl implements WxMerchantPowerBillConfigService { | |||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||
| @Autowired | |||
| WxMerchantPowerBillConfigMapper wxMerchantPowerBillConfigMapper; | |||
| @Autowired | |||
| WxMerchantMapper wxMerchantMapper; | |||
| @Override | |||
| public PageInfo<WxMerchantPowerBillConfig> listAsPage(WxMerchantPowerBillConfig record, Integer pageIndex, Integer pageSize) { | |||
| return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxMerchantPowerBillConfigMapper.findList(record)); | |||
| } | |||
| @Override | |||
| public WxMerchantPowerBillConfig getById(Long id) { | |||
| return wxMerchantPowerBillConfigMapper.selectByPrimaryKey(id); | |||
| } | |||
| @Override | |||
| @Transactional(propagation = Propagation.REQUIRED, rollbackFor = {Exception.class}) | |||
| public ResultData saveOrUpdate(WxMerchantPowerBillConfig config) { | |||
| Date date = new Date(); | |||
| if (config.getId() == null) { | |||
| WxMerchant wxMerchant = wxMerchantMapper.selectByPrimaryKey(config.getMerchantId()); | |||
| if (wxMerchant == null) { | |||
| return new ResultData(ErrorCode.MERCHANT_INFO_NOT_FOUND); | |||
| } | |||
| config.setMerchantName(wxMerchant.getName()); | |||
| config.setMerchantType(wxMerchant.getType()); | |||
| final IdWorker idWorker = IdWorker.get(); | |||
| config.setId(idWorker.nextId()); | |||
| config.setCreateDate(date); | |||
| config.setUpdateDate(date); | |||
| wxMerchantPowerBillConfigMapper.insertSelective(config); | |||
| } else { | |||
| config.setUpdateDate(date); | |||
| wxMerchantPowerBillConfigMapper.updateByPrimaryKeySelective(config); | |||
| } | |||
| return new ResultData(); | |||
| } | |||
| @Override | |||
| public void deleteById(Long id) { | |||
| wxMerchantPowerBillConfigMapper.deleteByPrimaryKey(id); | |||
| } | |||
| } | |||
| @@ -0,0 +1,65 @@ | |||
| package com.iformall.service.impl; | |||
| import com.github.pagehelper.PageHelper; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.common.IdWorker; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.domain.po.WxPowerBillAutoConfig; | |||
| import com.iformall.mapper.WxMerchantMapper; | |||
| import com.iformall.mapper.WxPowerBillAutoConfigMapper; | |||
| import com.iformall.service.WxPowerBillAutoConfigService; | |||
| import lombok.extern.slf4j.Slf4j; | |||
| import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.stereotype.Service; | |||
| import org.springframework.transaction.annotation.Propagation; | |||
| import org.springframework.transaction.annotation.Transactional; | |||
| import java.util.Date; | |||
| /** | |||
| * @author gongbiao | |||
| */ | |||
| @Service | |||
| @Slf4j | |||
| public class WxPowerBillAutoConfigServiceImpl implements WxPowerBillAutoConfigService { | |||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||
| @Autowired | |||
| WxPowerBillAutoConfigMapper wxPowerBillAutoConfigMapper; | |||
| @Autowired | |||
| WxMerchantMapper wxMerchantMapper; | |||
| @Override | |||
| public PageInfo<WxPowerBillAutoConfig> listAsPage(WxPowerBillAutoConfig record, Integer pageIndex, Integer pageSize) { | |||
| return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxPowerBillAutoConfigMapper.findList(record)); | |||
| } | |||
| @Override | |||
| public WxPowerBillAutoConfig getConfig(String tenantId) { | |||
| WxPowerBillAutoConfig wxPowerBillAutoConfig = new WxPowerBillAutoConfig(); | |||
| wxPowerBillAutoConfig.setTenantId(tenantId); | |||
| return wxPowerBillAutoConfigMapper.selectOne(wxPowerBillAutoConfig); | |||
| } | |||
| @Override | |||
| @Transactional(propagation = Propagation.REQUIRED, rollbackFor = {Exception.class}) | |||
| public ResultData modify(WxPowerBillAutoConfig config) { | |||
| Date date = new Date(); | |||
| if (config.getId() == null) { | |||
| final IdWorker idWorker = IdWorker.get(); | |||
| config.setId(idWorker.nextId()); | |||
| config.setCreateDate(date); | |||
| config.setUpdateDate(date); | |||
| wxPowerBillAutoConfigMapper.insertSelective(config); | |||
| } else { | |||
| config.setUpdateDate(date); | |||
| wxPowerBillAutoConfigMapper.updateByPrimaryKeySelective(config); | |||
| } | |||
| return new ResultData(config); | |||
| } | |||
| } | |||
| @@ -0,0 +1,61 @@ | |||
| <?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.iformall.mapper.WxMerchantPowerBillConfigMapper"> | |||
| <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxMerchantPowerBillConfig"> | |||
| <id column="id" jdbcType="BIGINT" property="id"/> | |||
| <result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/> | |||
| <result column="merchant_id" jdbcType="BIGINT" property="merchantId"/> | |||
| <result column="merchant_name" jdbcType="VARCHAR" property="merchantName"/> | |||
| <result column="merchant_type" jdbcType="VARCHAR" property="merchantType"/> | |||
| <result column="build_way" jdbcType="VARCHAR" property="buildway"/> | |||
| <result column="price" jdbcType="VARCHAR" property="price"/> | |||
| <result column="create_date" jdbcType="TIMESTAMP" property="createDate"/> | |||
| <result column="update_date" jdbcType="TIMESTAMP" property="updateDate"/> | |||
| </resultMap> | |||
| <sql id="allColumns"> | |||
| `id`,`tenant_id`,`merchant_id`,`merchant_name`,`merchant_type`,`build_way`,`price`,`create_date`,`update_date` | |||
| </sql> | |||
| <sql id="dynamicWhereConditions"> | |||
| where 1 = 1 | |||
| <if test=" null != id "> | |||
| and `id` = #{id} | |||
| </if> | |||
| <if test=" null != tenantId "> | |||
| and `tenant_id` = #{tenantId} | |||
| </if> | |||
| <if test=" null != merchantName and ''!=merchantName"> | |||
| and `merchant_name` like concat('%', #{merchantName},'%') | |||
| </if> | |||
| <if test=" null != merchantType "> | |||
| and `merchant_type` = #{merchantType} | |||
| </if> | |||
| <if test=" null != buildway "> | |||
| and `build_way` = #{build_way} | |||
| </if> | |||
| <if test=" null != ids "> | |||
| and id in | |||
| <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | |||
| #{idItem} | |||
| </foreach> | |||
| </if> | |||
| <if test=" null != sortColumns">order by ${sortColumns}</if> | |||
| </sql> | |||
| <select id="findList" parameterType="com.iformall.domain.po.KwBox" resultMap="BaseResultMap"> | |||
| select | |||
| <include refid="allColumns"/> | |||
| from wx_merchant_power_bill_config | |||
| <include refid="dynamicWhereConditions"/> | |||
| </select> | |||
| </mapper> | |||
| @@ -0,0 +1,46 @@ | |||
| <?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.iformall.mapper.WxPowerBillAutoConfigMapper"> | |||
| <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxPowerBillAutoConfig"> | |||
| <id column="id" jdbcType="BIGINT" property="id"/> | |||
| <result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/> | |||
| <result column="unit_price" jdbcType="VARCHAR" property="unitPrice"/> | |||
| <result column="build_day" jdbcType="INTEGER" property="buildDay"/> | |||
| <result column="receive_day" jdbcType="INTEGER" property="receiveDay"/> | |||
| <result column="create_date" jdbcType="TIMESTAMP" property="createDate"/> | |||
| <result column="update_date" jdbcType="TIMESTAMP" property="updateDate"/> | |||
| </resultMap> | |||
| <sql id="allColumns"> | |||
| `id`,`tenant_id`,`unit_price`,`build_day`,`receive_day`,`create_date`,`update_date` | |||
| </sql> | |||
| <sql id="dynamicWhereConditions"> | |||
| where 1 = 1 | |||
| <if test=" null != id "> | |||
| and `id` = #{id} | |||
| </if> | |||
| <if test=" null != tenantId "> | |||
| and `tenant_id` = #{tenantId} | |||
| </if> | |||
| <if test=" null != ids "> | |||
| and id in | |||
| <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | |||
| #{idItem} | |||
| </foreach> | |||
| </if> | |||
| <if test=" null != sortColumns">order by ${sortColumns}</if> | |||
| </sql> | |||
| <select id="findList" parameterType="com.iformall.domain.po.KwBox" resultMap="BaseResultMap"> | |||
| select | |||
| <include refid="allColumns"/> | |||
| from wx_power_bill_auto_config | |||
| <include refid="dynamicWhereConditions"/> | |||
| </select> | |||
| </mapper> | |||