视频后台管理,提成计算优化
This commit is contained in:
		| @@ -22,6 +22,8 @@ public class SysNutritionalVideo extends BaseEntity | ||||
|     @Excel(name = "视频分类ID") | ||||
|     private Long cateId; | ||||
|  | ||||
|     private String cateName; | ||||
|  | ||||
|     /** 阿里云视频ID */ | ||||
|     @Excel(name = "阿里云视频ID") | ||||
|     private String videoId; | ||||
| @@ -50,6 +52,16 @@ public class SysNutritionalVideo extends BaseEntity | ||||
|     @Excel(name = "是否显示,0不显示 1显示,默认0") | ||||
|     private Integer showFlag; | ||||
|  | ||||
|     /** 优先级,默认0 */ | ||||
|     @Excel(name = "优先级,默认0") | ||||
|     private Long priorityLevel; | ||||
|  | ||||
|     /** 视频付费等级,0无需付费 1客户可看 2付费可看 */ | ||||
|     @Excel(name = "视频付费等级,0无需付费 1客户可看 2付费可看") | ||||
|     private Long payLevel; | ||||
|  | ||||
|     private String payLevelName; | ||||
|  | ||||
|     /** 删除标识,0未删除 1已删除,默认0 */ | ||||
|     private Integer delFlag; | ||||
|  | ||||
|   | ||||
| @@ -0,0 +1,33 @@ | ||||
| package com.stdiet.custom.domain; | ||||
|  | ||||
| import lombok.Data; | ||||
| import org.apache.commons.lang3.builder.ToStringBuilder; | ||||
| import org.apache.commons.lang3.builder.ToStringStyle; | ||||
| import com.stdiet.common.annotation.Excel; | ||||
| import com.stdiet.common.core.domain.BaseEntity; | ||||
|  | ||||
| /** | ||||
|  * 视频分类对象 sys_video_classify | ||||
|  * | ||||
|  * @author xzj | ||||
|  * @date 2021-05-05 | ||||
|  */ | ||||
| @Data | ||||
| public class SysVideoClassify extends BaseEntity | ||||
| { | ||||
|     private static final long serialVersionUID = 1L; | ||||
|  | ||||
|     /** $column.columnComment */ | ||||
|     private Long id; | ||||
|  | ||||
|     /** 分类名称 */ | ||||
|     @Excel(name = "分类名称") | ||||
|     private String cateName; | ||||
|  | ||||
|     /** 类型标识,0全部可看 1客户可看 2额外付费观看 */ | ||||
|     @Excel(name = "类型标识,0全部可看 1客户可看 2额外付费观看") | ||||
|     private Integer payFlag; | ||||
|  | ||||
|     /** 删除标识 0未删除 1已删除 */ | ||||
|     private Integer delFlag; | ||||
| } | ||||
| @@ -0,0 +1,67 @@ | ||||
| package com.stdiet.custom.mapper; | ||||
|  | ||||
| import java.util.List; | ||||
| import com.stdiet.custom.domain.SysVideoClassify; | ||||
|  | ||||
| /** | ||||
|  * 视频分类Mapper接口 | ||||
|  * | ||||
|  * @author xzj | ||||
|  * @date 2021-05-05 | ||||
|  */ | ||||
| public interface SysVideoClassifyMapper | ||||
| { | ||||
|     /** | ||||
|      * 查询视频分类 | ||||
|      * | ||||
|      * @param id 视频分类ID | ||||
|      * @return 视频分类 | ||||
|      */ | ||||
|     public SysVideoClassify selectSysVideoClassifyById(Long id); | ||||
|  | ||||
|     /** | ||||
|      * 查询视频分类列表 | ||||
|      * | ||||
|      * @param sysVideoClassify 视频分类 | ||||
|      * @return 视频分类集合 | ||||
|      */ | ||||
|     public List<SysVideoClassify> selectSysVideoClassifyList(SysVideoClassify sysVideoClassify); | ||||
|  | ||||
|     /** | ||||
|      * 新增视频分类 | ||||
|      * | ||||
|      * @param sysVideoClassify 视频分类 | ||||
|      * @return 结果 | ||||
|      */ | ||||
|     public int insertSysVideoClassify(SysVideoClassify sysVideoClassify); | ||||
|  | ||||
|     /** | ||||
|      * 修改视频分类 | ||||
|      * | ||||
|      * @param sysVideoClassify 视频分类 | ||||
|      * @return 结果 | ||||
|      */ | ||||
|     public int updateSysVideoClassify(SysVideoClassify sysVideoClassify); | ||||
|  | ||||
|     /** | ||||
|      * 删除视频分类 | ||||
|      * | ||||
|      * @param id 视频分类ID | ||||
|      * @return 结果 | ||||
|      */ | ||||
|     public int deleteSysVideoClassifyById(Long id); | ||||
|  | ||||
|     /** | ||||
|      * 批量删除视频分类 | ||||
|      * | ||||
|      * @param ids 需要删除的数据ID | ||||
|      * @return 结果 | ||||
|      */ | ||||
|     public int deleteSysVideoClassifyByIds(Long[] ids); | ||||
|  | ||||
|     /** | ||||
|      * 获取所有类别 | ||||
|      * @return | ||||
|      */ | ||||
|     public List<SysVideoClassify> getAllClassify(); | ||||
| } | ||||
| @@ -27,7 +27,7 @@ public interface ISysNutritionalVideoService | ||||
|      * @param sysNutritionalVideo 营养视频 | ||||
|      * @return 营养视频集合 | ||||
|      */ | ||||
|     public List<SysNutritionalVideo> selectSysNutritionalVideoList(SysNutritionalVideo sysNutritionalVideo); | ||||
|     public List<SysNutritionalVideo> selectSysNutritionalVideoList(SysNutritionalVideo sysNutritionalVideo, boolean flag); | ||||
|  | ||||
|     /** | ||||
|      * 新增营养视频 | ||||
|   | ||||
| @@ -0,0 +1,67 @@ | ||||
| package com.stdiet.custom.service; | ||||
|  | ||||
| import java.util.List; | ||||
| import com.stdiet.custom.domain.SysVideoClassify; | ||||
|  | ||||
| /** | ||||
|  * 视频分类Service接口 | ||||
|  * | ||||
|  * @author xzj | ||||
|  * @date 2021-05-05 | ||||
|  */ | ||||
| public interface ISysVideoClassifyService | ||||
| { | ||||
|     /** | ||||
|      * 查询视频分类 | ||||
|      * | ||||
|      * @param id 视频分类ID | ||||
|      * @return 视频分类 | ||||
|      */ | ||||
|     public SysVideoClassify selectSysVideoClassifyById(Long id); | ||||
|  | ||||
|     /** | ||||
|      * 查询视频分类列表 | ||||
|      * | ||||
|      * @param sysVideoClassify 视频分类 | ||||
|      * @return 视频分类集合 | ||||
|      */ | ||||
|     public List<SysVideoClassify> selectSysVideoClassifyList(SysVideoClassify sysVideoClassify); | ||||
|  | ||||
|     /** | ||||
|      * 新增视频分类 | ||||
|      * | ||||
|      * @param sysVideoClassify 视频分类 | ||||
|      * @return 结果 | ||||
|      */ | ||||
|     public int insertSysVideoClassify(SysVideoClassify sysVideoClassify); | ||||
|  | ||||
|     /** | ||||
|      * 修改视频分类 | ||||
|      * | ||||
|      * @param sysVideoClassify 视频分类 | ||||
|      * @return 结果 | ||||
|      */ | ||||
|     public int updateSysVideoClassify(SysVideoClassify sysVideoClassify); | ||||
|  | ||||
|     /** | ||||
|      * 批量删除视频分类 | ||||
|      * | ||||
|      * @param ids 需要删除的视频分类ID | ||||
|      * @return 结果 | ||||
|      */ | ||||
|     public int deleteSysVideoClassifyByIds(Long[] ids); | ||||
|  | ||||
|     /** | ||||
|      * 删除视频分类信息 | ||||
|      * | ||||
|      * @param id 视频分类ID | ||||
|      * @return 结果 | ||||
|      */ | ||||
|     public int deleteSysVideoClassifyById(Long id); | ||||
|  | ||||
|     /** | ||||
|      * 获取所有类别 | ||||
|      * @return | ||||
|      */ | ||||
|     public List<SysVideoClassify> getAllClassify(); | ||||
| } | ||||
| @@ -296,7 +296,7 @@ public class SysCommissionDayServiceImpl implements ISysCommissionDayService { | ||||
|         //该笔订单当月的成交总额 | ||||
|         sysOrderCommisionDayDetail.setMonthOrderTotalAmount(everyMonthTotalAmountMap.get(yearMonth)); | ||||
|         //该笔订单对应提成比例 | ||||
|         sysOrderCommisionDayDetail.setCommissionRate(rateMap.get(yearMonth)); | ||||
|         sysOrderCommisionDayDetail.setCommissionRate(rateMap.get(yearMonth) == null ? rateMap.get("190001") : rateMap.get(yearMonth)); | ||||
|         //计算该笔订单总提成 | ||||
|         sysOrderCommisionDayDetail.setOrderCommission(getMoney(sysOrderCommisionDayDetail.getOrderAmount().doubleValue() * sysOrderCommisionDayDetail.getCommissionRate() / 100D)); | ||||
|         //每年每月提成 | ||||
| @@ -357,6 +357,8 @@ public class SysCommissionDayServiceImpl implements ISysCommissionDayService { | ||||
|         tmpQueryCom.setPostId(postId); | ||||
|         List<SysCommision> tmpComList = sysCommisionMapper.selectSysCommisionList(tmpQueryCom); | ||||
|         Map<String, Float> rateMap = new TreeMap<>(new MyComparator()); | ||||
|         //取第一个区间为默认提成比例 | ||||
|         rateMap.put("190001", (tmpComList != null && tmpComList.size() > 0) ? tmpComList.get(0).getRate() : 0.0F); | ||||
|         for(String yearMonth : amountMap.keySet()){ | ||||
|             BigDecimal orderAmount = amountMap.get(yearMonth); | ||||
|             rateMap.put(yearMonth, 0F); | ||||
|   | ||||
| @@ -9,6 +9,7 @@ import com.aliyun.vod20170321.models.SearchMediaResponse; | ||||
| import com.aliyun.vod20170321.models.SearchMediaResponseBody; | ||||
| import com.stdiet.common.utils.AliyunVideoUtils; | ||||
| import com.stdiet.common.utils.DateUtils; | ||||
| import com.stdiet.common.utils.oss.AliyunOSSUtils; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.stereotype.Service; | ||||
| import com.stdiet.custom.mapper.SysNutritionalVideoMapper; | ||||
| @@ -46,9 +47,24 @@ public class SysNutritionalVideoServiceImpl implements ISysNutritionalVideoServi | ||||
|      * @return 营养视频 | ||||
|      */ | ||||
|     @Override | ||||
|     public List<SysNutritionalVideo> selectSysNutritionalVideoList(SysNutritionalVideo sysNutritionalVideo) | ||||
|     public List<SysNutritionalVideo> selectSysNutritionalVideoList(SysNutritionalVideo sysNutritionalVideo, boolean flag) | ||||
|     { | ||||
|         return sysNutritionalVideoMapper.selectSysNutritionalVideoList(sysNutritionalVideo); | ||||
|         List<SysNutritionalVideo> list = sysNutritionalVideoMapper.selectSysNutritionalVideoList(sysNutritionalVideo); | ||||
|         if(flag && list != null && list.size() > 0){ | ||||
|             List<String> fileUrl = new ArrayList<>(); | ||||
|             for (SysNutritionalVideo video : list) { | ||||
|                 fileUrl.add(video.getCoverUrl()); | ||||
|             } | ||||
|             List<String> downUrlList = AliyunOSSUtils.generatePresignedUrl(fileUrl); | ||||
|             if(downUrlList != null && downUrlList.size() > 0){ | ||||
|                 int index = 0; | ||||
|                 for (String downUrl : downUrlList) { | ||||
|                     list.get(index).setCoverUrl(downUrl); | ||||
|                     index++; | ||||
|                 } | ||||
|             } | ||||
|         } | ||||
|         return list; | ||||
|     } | ||||
|  | ||||
|     /** | ||||
| @@ -133,8 +149,7 @@ public class SysNutritionalVideoServiceImpl implements ISysNutritionalVideoServi | ||||
|                         sysNutritionalVideo.setCoverUrl(media.video.coverURL); | ||||
|                         sysNutritionalVideo.setShowFlag(getStatus(media.video.getStatus())); | ||||
|                         sysNutritionalVideo.setTags(media.video.tags); | ||||
|                         String createTime = media.video.creationTime; | ||||
|                         System.out.println(createTime); | ||||
|                         //String createTime = media.video.creationTime; | ||||
|                         sysNutritionalVideo.setDescription(media.video.description); | ||||
|                         sysNutritionalVideo.setVideoId(media.video.videoId); | ||||
|                         nutritionalVideoList.add(sysNutritionalVideo); | ||||
|   | ||||
| @@ -0,0 +1,105 @@ | ||||
| package com.stdiet.custom.service.impl; | ||||
|  | ||||
| import java.util.List; | ||||
| import com.stdiet.common.utils.DateUtils; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.stereotype.Service; | ||||
| import com.stdiet.custom.mapper.SysVideoClassifyMapper; | ||||
| import com.stdiet.custom.domain.SysVideoClassify; | ||||
| import com.stdiet.custom.service.ISysVideoClassifyService; | ||||
|  | ||||
| /** | ||||
|  * 视频分类Service业务层处理 | ||||
|  * | ||||
|  * @author xzj | ||||
|  * @date 2021-05-05 | ||||
|  */ | ||||
| @Service | ||||
| public class SysVideoClassifyServiceImpl implements ISysVideoClassifyService | ||||
| { | ||||
|     @Autowired | ||||
|     private SysVideoClassifyMapper sysVideoClassifyMapper; | ||||
|  | ||||
|     /** | ||||
|      * 查询视频分类 | ||||
|      * | ||||
|      * @param id 视频分类ID | ||||
|      * @return 视频分类 | ||||
|      */ | ||||
|     @Override | ||||
|     public SysVideoClassify selectSysVideoClassifyById(Long id) | ||||
|     { | ||||
|         return sysVideoClassifyMapper.selectSysVideoClassifyById(id); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 查询视频分类列表 | ||||
|      * | ||||
|      * @param sysVideoClassify 视频分类 | ||||
|      * @return 视频分类 | ||||
|      */ | ||||
|     @Override | ||||
|     public List<SysVideoClassify> selectSysVideoClassifyList(SysVideoClassify sysVideoClassify) | ||||
|     { | ||||
|         return sysVideoClassifyMapper.selectSysVideoClassifyList(sysVideoClassify); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 新增视频分类 | ||||
|      * | ||||
|      * @param sysVideoClassify 视频分类 | ||||
|      * @return 结果 | ||||
|      */ | ||||
|     @Override | ||||
|     public int insertSysVideoClassify(SysVideoClassify sysVideoClassify) | ||||
|     { | ||||
|         sysVideoClassify.setCreateTime(DateUtils.getNowDate()); | ||||
|         return sysVideoClassifyMapper.insertSysVideoClassify(sysVideoClassify); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 修改视频分类 | ||||
|      * | ||||
|      * @param sysVideoClassify 视频分类 | ||||
|      * @return 结果 | ||||
|      */ | ||||
|     @Override | ||||
|     public int updateSysVideoClassify(SysVideoClassify sysVideoClassify) | ||||
|     { | ||||
|         sysVideoClassify.setUpdateTime(DateUtils.getNowDate()); | ||||
|         return sysVideoClassifyMapper.updateSysVideoClassify(sysVideoClassify); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 批量删除视频分类 | ||||
|      * | ||||
|      * @param ids 需要删除的视频分类ID | ||||
|      * @return 结果 | ||||
|      */ | ||||
|     @Override | ||||
|     public int deleteSysVideoClassifyByIds(Long[] ids) | ||||
|     { | ||||
|         return sysVideoClassifyMapper.deleteSysVideoClassifyByIds(ids); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 删除视频分类信息 | ||||
|      * | ||||
|      * @param id 视频分类ID | ||||
|      * @return 结果 | ||||
|      */ | ||||
|     @Override | ||||
|     public int deleteSysVideoClassifyById(Long id) | ||||
|     { | ||||
|         return sysVideoClassifyMapper.deleteSysVideoClassifyById(id); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 获取所有类别 | ||||
|      * @return | ||||
|      */ | ||||
|     @Override | ||||
|     public List<SysVideoClassify> getAllClassify(){ | ||||
|         return sysVideoClassifyMapper.getAllClassify(); | ||||
|     } | ||||
| } | ||||
| @@ -14,22 +14,39 @@ | ||||
|         <result property="videoSize"    column="video_size"    /> | ||||
|         <result property="tags"    column="tags"    /> | ||||
|         <result property="showFlag"    column="show_flag"    /> | ||||
|         <result property="priorityLevel"    column="priority_level"    /> | ||||
|         <result property="payLevel"    column="pay_level"    /> | ||||
|         <result property="createTime"    column="create_time"    /> | ||||
|         <result property="createBy"    column="create_by"    /> | ||||
|         <result property="updateTime"    column="update_time"    /> | ||||
|         <result property="updateBy"    column="update_by"    /> | ||||
|         <result property="delFlag"    column="del_flag"    /> | ||||
|  | ||||
|         <result property="payLevelName" column="pay_level_name"></result> | ||||
|         <result property="cateName" column="cate_name"></result> | ||||
|     </resultMap> | ||||
|  | ||||
|     <sql id="selectSysNutritionalVideoVo"> | ||||
|         select id, cate_id, video_id, cover_url, title, description, video_size, tags, show_flag, create_time, create_by, update_time, update_by, del_flag from sys_nutritional_video | ||||
|         select id, cate_id, video_id, cover_url, title, description, priority_level,pay_level,video_size, tags, show_flag, create_time, create_by, update_time, update_by, del_flag from sys_nutritional_video | ||||
|     </sql> | ||||
|  | ||||
|     <select id="selectSysNutritionalVideoList" parameterType="SysNutritionalVideo" resultMap="SysNutritionalVideoResult"> | ||||
|         <include refid="selectSysNutritionalVideoVo"/> where del_flag = 0 | ||||
|         select snv.id, snv.cate_id, snv.video_id, snv.cover_url, snv.title, snv.description, snv.priority_level,snv.pay_level,snv.video_size, snv.tags, snv.show_flag, snv.create_time, | ||||
|         pay.dict_label as pay_level_name, svc.cate_name | ||||
|         from sys_nutritional_video snv | ||||
|         left join (SELECT dict_label, dict_value FROM sys_dict_data WHERE dict_type = 'video_pay_level') AS pay ON pay.dict_value = snv.pay_level | ||||
|         left join sys_video_classify svc on svc.id = snv.cate_id and svc.del_flag = 0 | ||||
|         where snv.del_flag = 0 | ||||
|         <if test="showFlag != null"> | ||||
|             and show_flag = #{showFlag} | ||||
|             and snv.show_flag = #{showFlag} | ||||
|         </if> | ||||
|         <if test="cateId != null"> | ||||
|             and snv.cate_id = #{cateId} | ||||
|         </if> | ||||
|         <if test="key != null and key != ''"> | ||||
|             and (snv.title like concat('%',#{key},'%') or snv.description like concat('%',#{key},'%')) | ||||
|         </if> | ||||
|         order by snv.priority_level DESC,snv.create_time DESC | ||||
|     </select> | ||||
|  | ||||
|     <select id="selectSysNutritionalVideoById" parameterType="Long" resultMap="SysNutritionalVideoResult"> | ||||
| @@ -48,8 +65,10 @@ | ||||
|             <if test="videoSize != null">video_size,</if> | ||||
|             <if test="tags != null">tags,</if> | ||||
|             <if test="showFlag != null">show_flag,</if> | ||||
|             <if test="priorityLevel != null">priority_level,</if> | ||||
|             <if test="createTime != null">create_time,</if> | ||||
|             <if test="createBy != null">create_by,</if> | ||||
|             <if test="payLevel != null">pay_level,</if> | ||||
|             <if test="updateTime != null">update_time,</if> | ||||
|             <if test="updateBy != null">update_by,</if> | ||||
|             <if test="delFlag != null">del_flag,</if> | ||||
| @@ -63,8 +82,10 @@ | ||||
|             <if test="videoSize != null">#{videoSize},</if> | ||||
|             <if test="tags != null">#{tags},</if> | ||||
|             <if test="showFlag != null">#{showFlag},</if> | ||||
|             <if test="priorityLevel != null">#{priorityLevel},</if> | ||||
|             <if test="createTime != null">#{createTime},</if> | ||||
|             <if test="createBy != null">#{createBy},</if> | ||||
|             <if test="payLevel != null">#{payLevel},</if> | ||||
|             <if test="updateTime != null">#{updateTime},</if> | ||||
|             <if test="updateBy != null">#{updateBy},</if> | ||||
|             <if test="delFlag != null">#{delFlag},</if> | ||||
| @@ -82,8 +103,10 @@ | ||||
|             <if test="videoSize != null">video_size = #{videoSize},</if> | ||||
|             <if test="tags != null">tags = #{tags},</if> | ||||
|             <if test="showFlag != null">show_flag = #{showFlag},</if> | ||||
|             <if test="priorityLevel != null">priority_level = #{priorityLevel},</if> | ||||
|             <if test="createTime != null">create_time = #{createTime},</if> | ||||
|             <if test="createBy != null">create_by = #{createBy},</if> | ||||
|             <if test="payLevel != null">pay_level = #{payLevel},</if> | ||||
|             <if test="updateTime != null">update_time = #{updateTime},</if> | ||||
|             <if test="updateBy != null">update_by = #{updateBy},</if> | ||||
|             <if test="delFlag != null">del_flag = #{delFlag},</if> | ||||
|   | ||||
| @@ -0,0 +1,85 @@ | ||||
| <?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.stdiet.custom.mapper.SysVideoClassifyMapper"> | ||||
|  | ||||
|     <resultMap type="SysVideoClassify" id="SysVideoClassifyResult"> | ||||
|         <result property="id"    column="id"    /> | ||||
|         <result property="cateName"    column="cate_name"    /> | ||||
|         <result property="payFlag"    column="pay_flag"    /> | ||||
|         <result property="createTime"    column="create_time"    /> | ||||
|         <result property="createBy"    column="create_by"    /> | ||||
|         <result property="updateTime"    column="update_time"    /> | ||||
|         <result property="updateBy"    column="update_by"    /> | ||||
|         <result property="delFlag"    column="del_flag"    /> | ||||
|     </resultMap> | ||||
|  | ||||
|     <sql id="selectSysVideoClassifyVo"> | ||||
|         select id, cate_name, pay_flag, create_time, create_by, update_time, update_by, del_flag from sys_video_classify | ||||
|     </sql> | ||||
|  | ||||
|     <select id="selectSysVideoClassifyList" parameterType="SysVideoClassify" resultMap="SysVideoClassifyResult"> | ||||
|         <include refid="selectSysVideoClassifyVo"/> | ||||
|         where del_flag = 0 | ||||
|     </select> | ||||
|  | ||||
|     <select id="selectSysVideoClassifyById" parameterType="Long" resultMap="SysVideoClassifyResult"> | ||||
|         <include refid="selectSysVideoClassifyVo"/> | ||||
|         where id = #{id} and del_flag =  0 | ||||
|     </select> | ||||
|  | ||||
|     <insert id="insertSysVideoClassify" parameterType="SysVideoClassify"> | ||||
|         insert into sys_video_classify | ||||
|         <trim prefix="(" suffix=")" suffixOverrides=","> | ||||
|             <if test="id != null">id,</if> | ||||
|             <if test="cateName != null">cate_name,</if> | ||||
|             <if test="payFlag != null">pay_flag,</if> | ||||
|             <if test="createTime != null">create_time,</if> | ||||
|             <if test="createBy != null">create_by,</if> | ||||
|             <if test="updateTime != null">update_time,</if> | ||||
|             <if test="updateBy != null">update_by,</if> | ||||
|             <if test="delFlag != null">del_flag,</if> | ||||
|         </trim> | ||||
|         <trim prefix="values (" suffix=")" suffixOverrides=","> | ||||
|             <if test="id != null">#{id},</if> | ||||
|             <if test="cateName != null">#{cateName},</if> | ||||
|             <if test="payFlag != null">#{payFlag},</if> | ||||
|             <if test="createTime != null">#{createTime},</if> | ||||
|             <if test="createBy != null">#{createBy},</if> | ||||
|             <if test="updateTime != null">#{updateTime},</if> | ||||
|             <if test="updateBy != null">#{updateBy},</if> | ||||
|             <if test="delFlag != null">#{delFlag},</if> | ||||
|         </trim> | ||||
|     </insert> | ||||
|  | ||||
|     <update id="updateSysVideoClassify" parameterType="SysVideoClassify"> | ||||
|         update sys_video_classify | ||||
|         <trim prefix="SET" suffixOverrides=","> | ||||
|             <if test="cateName != null">cate_name = #{cateName},</if> | ||||
|             <if test="payFlag != null">pay_flag = #{payFlag},</if> | ||||
|             <if test="createTime != null">create_time = #{createTime},</if> | ||||
|             <if test="createBy != null">create_by = #{createBy},</if> | ||||
|             <if test="updateTime != null">update_time = #{updateTime},</if> | ||||
|             <if test="updateBy != null">update_by = #{updateBy},</if> | ||||
|             <if test="delFlag != null">del_flag = #{delFlag},</if> | ||||
|         </trim> | ||||
|         where id = #{id} | ||||
|     </update> | ||||
|  | ||||
|     <update id="deleteSysVideoClassifyById" parameterType="Long"> | ||||
|         update sys_video_classify set del_flag = 1 where id = #{id} | ||||
|     </update> | ||||
|  | ||||
|     <update id="deleteSysVideoClassifyByIds" parameterType="String"> | ||||
|         update sys_video_classify set del_flag = 1 where id in | ||||
|         <foreach item="id" collection="array" open="(" separator="," close=")"> | ||||
|             #{id} | ||||
|         </foreach> | ||||
|     </update> | ||||
|  | ||||
|     <select id="getAllClassify" resultMap="SysVideoClassifyResult"> | ||||
|         select id,cate_name from sys_video_classify where del_flag = 0 | ||||
|     </select> | ||||
|  | ||||
| </mapper> | ||||
		Reference in New Issue
	
	Block a user