| @@ -0,0 +1,88 @@ | |||||
| 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.WxFloatingLayer; | |||||
| import com.iformall.enums.EnumFloatingLayerStatus; | |||||
| import com.iformall.exception.MallinkException; | |||||
| import com.iformall.service.WxFloatingLayerService; | |||||
| 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("wxFloatingLayer") | |||||
| @Api(description = "首页浮层展示") | |||||
| public class WxFloatingLayerController extends BaseController { | |||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||||
| @Autowired | |||||
| private WxFloatingLayerService wxFloatingLayerService; | |||||
| @ApiOperation("分页列表接口") | |||||
| @GetMapping("list") | |||||
| @ApiImplicitParams({ | |||||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | |||||
| @SystemControllerLog(description = "列表") | |||||
| public ResultData list(@ModelAttribute WxFloatingLayer wxFloatingLayer, Integer pageNum, Integer pageSize) { | |||||
| logger.debug("[" + getIpAddr() + "] WxFloatingLayerController::list"); | |||||
| wxFloatingLayer.setTenantId(getTenantId()); | |||||
| wxFloatingLayer.setSortColumns(BaseEntity.SortField.CreateTime_DESC, BaseEntity.SortField.Id_DESC); | |||||
| final PageInfo<WxFloatingLayer> page = wxFloatingLayerService.listAsPage(wxFloatingLayer, pageNum, pageSize); | |||||
| return new ResultData(page); | |||||
| } | |||||
| @ApiOperation("新增接口") | |||||
| @PostMapping("add") | |||||
| @SystemControllerLog(description = "新增") | |||||
| public ResultData add(@RequestBody WxFloatingLayer wxFloatingLayer) { | |||||
| logger.debug("[" + getIpAddr() + "] WxFloatingLayerController::add"); | |||||
| wxFloatingLayer.setStatus(EnumFloatingLayerStatus.STATUS_THROW_IN.getCode()); | |||||
| wxFloatingLayer.setTenantId(getTenantId()); | |||||
| try { | |||||
| wxFloatingLayerService.saveOrUpdate(wxFloatingLayer); | |||||
| } catch (MallinkException e) { | |||||
| logger.error(e.getMessage()); | |||||
| return new ResultData(e.getErrorCode(), e.getMessage()); | |||||
| } | |||||
| return new ResultData(); | |||||
| } | |||||
| @ApiOperation("根据id更新接口") | |||||
| @PostMapping("update") | |||||
| @SystemControllerLog(description = "id更新") | |||||
| public ResultData update(@RequestBody WxFloatingLayer wxFloatingLayer) { | |||||
| logger.debug("[" + getIpAddr() + "] WxFloatingLayerController::update"); | |||||
| try { | |||||
| wxFloatingLayer.setStatus(EnumFloatingLayerStatus.STATUS_TAKE_OFFF.getCode()); | |||||
| return wxFloatingLayerService.saveOrUpdate(wxFloatingLayer); | |||||
| } catch (MallinkException e) { | |||||
| logger.error(e.getMessage()); | |||||
| return new ResultData(e.getErrorCode(), e.getMessage()); | |||||
| } | |||||
| } | |||||
| @ApiOperation("根据id查询接口") | |||||
| @GetMapping("/findById") | |||||
| @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | |||||
| @SystemControllerLog(description = "活动-查询") | |||||
| public ResultData findById(Long id) { | |||||
| logger.debug("[" + getIpAddr() + "] WxFloatingLayerController::findById"); | |||||
| WxFloatingLayer wxFloatingLayer = wxFloatingLayerService.getById(id); | |||||
| return new ResultData(Result.SUCCESS, "查询成功", wxFloatingLayer); | |||||
| } | |||||
| } | |||||
| @@ -0,0 +1,22 @@ | |||||
| create table wx_floting_layer( | |||||
| `id` bigint(20) NOT NULL COMMENT '主键ID', | |||||
| `tenant_id` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '租户ID', | |||||
| `cover_img` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '封面图', | |||||
| `produce_id` bigint(20) DEFAULT NULL COMMENT '产品ID', | |||||
| `page_path` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '小程序跳转路径', | |||||
| `status` smallint(2) DEFAULT NULL COMMENT '0上线 1下线', | |||||
| `create_time` datetime DEFAULT CURRENT_TIMESTAMP, | |||||
| `update_time` datetime DEFAULT CURRENT_TIMESTAMP, | |||||
| PRIMARY KEY (`id`), | |||||
| UNIQUE KEY `id_UNIQUE` (`id`) | |||||
| ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC COMMENT='首页浮层'; | |||||
| create table wx_cuser_floting_layer( | |||||
| `id` bigint(20) NOT NULL COMMENT '主键ID', | |||||
| `tenant_id` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '租户ID', | |||||
| `user_id` bigint(20) DEFAULT NULL COMMENT 'C端用户ID', | |||||
| `create_time` datetime DEFAULT CURRENT_TIMESTAMP, | |||||
| PRIMARY KEY (`id`), | |||||
| UNIQUE KEY `id_UNIQUE` (`id`) | |||||
| ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC COMMENT='用户首页浮层记录'; | |||||
| @@ -0,0 +1,40 @@ | |||||
| package com.iformall.controller; | |||||
| import com.iformall.annotation.AuthIgnore; | |||||
| import com.iformall.common.Result; | |||||
| import com.iformall.common.ResultData; | |||||
| import com.iformall.domain.po.WxFloatingLayer; | |||||
| import com.iformall.service.WxCuserFloatingLayerService; | |||||
| import io.swagger.annotations.Api; | |||||
| import io.swagger.annotations.ApiImplicitParam; | |||||
| 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.GetMapping; | |||||
| import org.springframework.web.bind.annotation.RequestMapping; | |||||
| import org.springframework.web.bind.annotation.RestController; | |||||
| /** | |||||
| * @author gongbiao | |||||
| */ | |||||
| @RestController | |||||
| @RequestMapping("/api/floatingLayer") | |||||
| @Api(description = "首页浮层") | |||||
| public class WxCuserFloatingLayerController extends BaseController { | |||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||||
| @Autowired | |||||
| WxCuserFloatingLayerService wxCuserFloatingLayerService; | |||||
| @AuthIgnore | |||||
| @ApiOperation("获取浮层") | |||||
| @GetMapping("/getFloatingLayer") | |||||
| @ApiImplicitParam(name = "openId", value = "openId", dataType = "String", paramType = "query", required = true) | |||||
| public ResultData getAppIcon(String openId) { | |||||
| WxFloatingLayer wxFloatingLayer = wxCuserFloatingLayerService.getFloatingLayer(openId); | |||||
| return new ResultData(Result.SUCCESS, "查询成功", wxFloatingLayer); | |||||
| } | |||||
| } | |||||
| @@ -0,0 +1,26 @@ | |||||
| package com.iformall.domain.po; | |||||
| import com.baomidou.mybatisplus.annotation.TableName; | |||||
| import lombok.Data; | |||||
| import lombok.EqualsAndHashCode; | |||||
| import java.util.Date; | |||||
| @TableName(value = "wx_cuser_floating_layer") | |||||
| @Data | |||||
| @EqualsAndHashCode(callSuper = true) | |||||
| public class WxCuserFloatingLayer extends BaseEntity { | |||||
| private static final long serialVersionUID = 1L; | |||||
| protected Long id; | |||||
| @io.swagger.annotations.ApiModelProperty(value = "租户ID", name = "tenantId") | |||||
| private String tenantId; | |||||
| @io.swagger.annotations.ApiModelProperty(value = "C端用户ID", name = "userId") | |||||
| private Long userId; | |||||
| @io.swagger.annotations.ApiModelProperty(value = "创建时间", name = "createTime") | |||||
| private Date createTime; | |||||
| } | |||||
| @@ -0,0 +1,38 @@ | |||||
| package com.iformall.domain.po; | |||||
| import com.baomidou.mybatisplus.annotation.TableName; | |||||
| import lombok.Data; | |||||
| import lombok.EqualsAndHashCode; | |||||
| import java.util.Date; | |||||
| @TableName(value = "wx_floating_layer") | |||||
| @Data | |||||
| @EqualsAndHashCode(callSuper = true) | |||||
| public class WxFloatingLayer extends BaseEntity { | |||||
| private static final long serialVersionUID = 1L; | |||||
| protected Long id; | |||||
| @io.swagger.annotations.ApiModelProperty(value = "租户ID", name = "tenantId") | |||||
| private String tenantId; | |||||
| @io.swagger.annotations.ApiModelProperty(value = "封面图", name = "coverImg") | |||||
| private String coverImg; | |||||
| @io.swagger.annotations.ApiModelProperty(value = "产品ID", name = "produceId") | |||||
| private Long produceId; | |||||
| @io.swagger.annotations.ApiModelProperty(value = "小程序跳转路径", name = "pagePath") | |||||
| private String pagePath; | |||||
| @io.swagger.annotations.ApiModelProperty(value = "0上线 1下线", name = "status") | |||||
| private Integer status; | |||||
| @io.swagger.annotations.ApiModelProperty(value = "创建时间", name = "createTime") | |||||
| private Date createTime; | |||||
| @io.swagger.annotations.ApiModelProperty(value = "更新时间", name = "updateTime") | |||||
| private Date updateTime; | |||||
| } | |||||
| @@ -0,0 +1,36 @@ | |||||
| package com.iformall.enums; | |||||
| /** | |||||
| * @author gongbiao | |||||
| */ | |||||
| public enum EnumFloatingLayerStatus { | |||||
| STATUS_THROW_IN(0, "已上线"), | |||||
| STATUS_TAKE_OFFF(1, "已下线"),; | |||||
| public static EnumFloatingLayerStatus getEnum(Integer code) { | |||||
| for (EnumFloatingLayerStatus value : values()) { | |||||
| if (value.getCode().equals(code)) { | |||||
| return value; | |||||
| } | |||||
| } | |||||
| return null; | |||||
| } | |||||
| private Integer code; | |||||
| private String message; | |||||
| EnumFloatingLayerStatus(Integer code, String message) { | |||||
| this.code = code; | |||||
| this.message = message; | |||||
| } | |||||
| public Integer getCode() { | |||||
| return code; | |||||
| } | |||||
| public String getMessage() { | |||||
| return message; | |||||
| } | |||||
| } | |||||
| @@ -0,0 +1,15 @@ | |||||
| package com.iformall.mapper; | |||||
| import com.iformall.common.CommonMapper; | |||||
| import com.iformall.domain.po.WxCuserFloatingLayer; | |||||
| import java.util.List; | |||||
| /** | |||||
| * @author gongbiao | |||||
| */ | |||||
| public interface WxCuserFloatingLayerMapper extends CommonMapper<WxCuserFloatingLayer, Long> { | |||||
| List<WxCuserFloatingLayer> findList(WxCuserFloatingLayer wxCuserFloatingLayer); | |||||
| } | |||||
| @@ -0,0 +1,15 @@ | |||||
| package com.iformall.mapper; | |||||
| import com.iformall.common.CommonMapper; | |||||
| import com.iformall.domain.po.WxFloatingLayer; | |||||
| import java.util.List; | |||||
| /** | |||||
| * @author gongbiao | |||||
| */ | |||||
| public interface WxFloatingLayerMapper extends CommonMapper<WxFloatingLayer, Long> { | |||||
| List<WxFloatingLayer> findList(WxFloatingLayer wxFloatingLayer); | |||||
| } | |||||
| @@ -0,0 +1,12 @@ | |||||
| package com.iformall.service; | |||||
| import com.iformall.domain.po.WxFloatingLayer; | |||||
| /** | |||||
| * @author gongbiao | |||||
| */ | |||||
| public interface WxCuserFloatingLayerService { | |||||
| WxFloatingLayer getFloatingLayer(String openId); | |||||
| } | |||||
| @@ -0,0 +1,38 @@ | |||||
| package com.iformall.service; | |||||
| import com.github.pagehelper.PageInfo; | |||||
| import com.iformall.common.ResultData; | |||||
| import com.iformall.domain.po.WxFloatingLayer; | |||||
| /** | |||||
| * @author gongbiao | |||||
| */ | |||||
| public interface WxFloatingLayerService { | |||||
| /** | |||||
| * 根据实体查询分页列表 | |||||
| * | |||||
| * @param record | |||||
| * @param pageIndex | |||||
| * @param pageSize | |||||
| * @return | |||||
| */ | |||||
| PageInfo<WxFloatingLayer> listAsPage(WxFloatingLayer record, Integer pageIndex, Integer pageSize); | |||||
| /** | |||||
| * 根据Id获得实体 | |||||
| * | |||||
| * @param id | |||||
| * @return | |||||
| */ | |||||
| WxFloatingLayer getById(Long id); | |||||
| /** | |||||
| * 保存或更新实体 | |||||
| * | |||||
| * @param record | |||||
| */ | |||||
| ResultData saveOrUpdate(WxFloatingLayer record); | |||||
| } | |||||
| @@ -0,0 +1,73 @@ | |||||
| package com.iformall.service.impl; | |||||
| import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | |||||
| import com.iformall.common.IdWorker; | |||||
| import com.iformall.domain.po.WxCUser; | |||||
| import com.iformall.domain.po.WxCuserFloatingLayer; | |||||
| import com.iformall.domain.po.WxFloatingLayer; | |||||
| import com.iformall.enums.EnumFloatingLayerStatus; | |||||
| import com.iformall.mapper.WxCUserMapper; | |||||
| import com.iformall.mapper.WxCuserFloatingLayerMapper; | |||||
| import com.iformall.mapper.WxFloatingLayerMapper; | |||||
| import com.iformall.service.WxCuserFloatingLayerService; | |||||
| import org.slf4j.Logger; | |||||
| import org.slf4j.LoggerFactory; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | |||||
| import org.springframework.stereotype.Service; | |||||
| import java.util.Date; | |||||
| /** | |||||
| * @author gongbiao | |||||
| */ | |||||
| @Service | |||||
| public class WxCuserFloatingLayerServiceImpl implements WxCuserFloatingLayerService { | |||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||||
| @Autowired | |||||
| WxCuserFloatingLayerMapper WxCuserFloatingLayerMapper; | |||||
| @Autowired | |||||
| WxFloatingLayerMapper WxFloatingLayerMapper; | |||||
| @Autowired | |||||
| WxCUserMapper WxCUserMapper; | |||||
| @Override | |||||
| public WxFloatingLayer getFloatingLayer(String openId) { | |||||
| //1 查看是否存在用户,用户不存在 直接返回浮层信息 | |||||
| WxCUser user = new WxCUser(); | |||||
| user.setOpenId(openId); | |||||
| WxCUser byOpenId = WxCUserMapper.findByOpenId(user); | |||||
| if (byOpenId == null) { | |||||
| return getWxFloatingLayer(); | |||||
| } | |||||
| //2 用户存在 查看是否已有弹出记录 没有 保存记录后返回浮层信息 | |||||
| WxCuserFloatingLayer wxCuserFloatingLayerQuery = new WxCuserFloatingLayer(); | |||||
| wxCuserFloatingLayerQuery.setUserId(byOpenId.getId()); | |||||
| WxCuserFloatingLayer wxCuserFloatingLayer = WxCuserFloatingLayerMapper.selectOne(new QueryWrapper<>(wxCuserFloatingLayerQuery)); | |||||
| if (wxCuserFloatingLayer == null) { | |||||
| saveCuserFloatingLayer(byOpenId); | |||||
| return getWxFloatingLayer(); | |||||
| } | |||||
| return null; | |||||
| } | |||||
| public void saveCuserFloatingLayer(WxCUser wxCUser) { | |||||
| WxCuserFloatingLayer wxCuserFloatingLayer; | |||||
| wxCuserFloatingLayer = new WxCuserFloatingLayer(); | |||||
| final IdWorker idWorker = IdWorker.get(); | |||||
| wxCuserFloatingLayer.setId(idWorker.nextId()); | |||||
| wxCuserFloatingLayer.setUserId(wxCUser.getId()); | |||||
| wxCuserFloatingLayer.setTenantId(wxCUser.getTenantId()); | |||||
| wxCuserFloatingLayer.setCreateTime(new Date()); | |||||
| WxCuserFloatingLayerMapper.insert(wxCuserFloatingLayer); | |||||
| } | |||||
| public WxFloatingLayer getWxFloatingLayer() { | |||||
| WxFloatingLayer wxFloatingLayer = new WxFloatingLayer(); | |||||
| wxFloatingLayer.setStatus(EnumFloatingLayerStatus.STATUS_THROW_IN.getCode()); | |||||
| return WxFloatingLayerMapper.selectOne(new QueryWrapper<>(wxFloatingLayer)); | |||||
| } | |||||
| } | |||||
| @@ -0,0 +1,65 @@ | |||||
| 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.Result; | |||||
| import com.iformall.common.ResultData; | |||||
| import com.iformall.domain.po.WxFloatingLayer; | |||||
| import com.iformall.mapper.WxFloatingLayerMapper; | |||||
| import com.iformall.service.WxFloatingLayerService; | |||||
| import org.apache.commons.lang3.StringUtils; | |||||
| 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 | |||||
| public class WxFloatingLayerServiceImpl implements WxFloatingLayerService { | |||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||||
| @Autowired | |||||
| WxFloatingLayerMapper WxFloatingLayerMapper; | |||||
| @Override | |||||
| public PageInfo<WxFloatingLayer> listAsPage(WxFloatingLayer record, Integer pageIndex, Integer pageSize) { | |||||
| return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> WxFloatingLayerMapper.findList(record)); | |||||
| } | |||||
| @Override | |||||
| public WxFloatingLayer getById(Long id) { | |||||
| return WxFloatingLayerMapper.selectById(id); | |||||
| } | |||||
| @Transactional(propagation = Propagation.REQUIRED, rollbackFor = {Exception.class}) | |||||
| @Override | |||||
| public ResultData saveOrUpdate(WxFloatingLayer wxFloatingLayer) { | |||||
| if (StringUtils.isEmpty(wxFloatingLayer.getCoverImg())) { | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "封面图不能为空"); | |||||
| } | |||||
| if (StringUtils.isEmpty(wxFloatingLayer.getPagePath())) { | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "小程序跳转路径不能为空"); | |||||
| } | |||||
| Date date = new Date(); | |||||
| if (wxFloatingLayer.getId() == null) { | |||||
| final IdWorker idWorker = IdWorker.get(); | |||||
| wxFloatingLayer.setId(idWorker.nextId()); | |||||
| wxFloatingLayer.setCreateTime(date); | |||||
| wxFloatingLayer.setUpdateTime(date); | |||||
| WxFloatingLayerMapper.insert(wxFloatingLayer); | |||||
| } else { | |||||
| wxFloatingLayer.setUpdateTime(date); | |||||
| WxFloatingLayerMapper.updateById(wxFloatingLayer); | |||||
| } | |||||
| return new ResultData(Result.SUCCESS, "操作成功"); | |||||
| } | |||||
| } | |||||
| @@ -0,0 +1,47 @@ | |||||
| <?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.WxCuserFloatingLayerMapper"> | |||||
| <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxCuserFloatingLayer"> | |||||
| <id column="id" jdbcType="BIGINT" property="id"/> | |||||
| <result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/> | |||||
| <result column="user_id" jdbcType="BIGINT" property="userId"/> | |||||
| <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/> | |||||
| </resultMap> | |||||
| <sql id="allColumns"> | |||||
| `id`, `tenant_id` , `user_id` , `create_time` | |||||
| </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 != userId "> | |||||
| and `user_id` = #{user_id} | |||||
| </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.WxCuserFloatingLayer" resultMap="BaseResultMap"> | |||||
| select | |||||
| <include refid="allColumns"/> | |||||
| from wx_cuser_floating_layer | |||||
| <include refid="dynamicWhereConditions"/> | |||||
| </select> | |||||
| </mapper> | |||||
| @@ -0,0 +1,51 @@ | |||||
| <?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.WxFloatingLayerMapper"> | |||||
| <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxFloatingLayer"> | |||||
| <id column="id" jdbcType="BIGINT" property="id"/> | |||||
| <result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/> | |||||
| <result column="cover_img" jdbcType="VARCHAR" property="coverImg"/> | |||||
| <result column="produce_id" jdbcType="VARCHAR" property="produceId"/> | |||||
| <result column="page_path" jdbcType="VARCHAR" property="pagePath"/> | |||||
| <result column="status" jdbcType="VARCHAR" property="status"/> | |||||
| <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/> | |||||
| <result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/> | |||||
| </resultMap> | |||||
| <sql id="allColumns"> | |||||
| `id`, `tenant_id` , `cover_img` , `produce_id`, `page_path` , `status`, `create_time`, `update_time` | |||||
| </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 != status "> | |||||
| and `status` = #{status} | |||||
| </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.WxFloatingLayer" resultMap="BaseResultMap"> | |||||
| select | |||||
| <include refid="allColumns"/> | |||||
| from wx_floating_layer | |||||
| <include refid="dynamicWhereConditions"/> | |||||
| </select> | |||||
| </mapper> | |||||