dev798
parent
02fe3d34af
commit
f707761ef3
|
@ -0,0 +1,23 @@
|
|||
package com.nuyu.product.model;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author: wangxinyuan
|
||||
* @Date: 2024/5/14 上午11:39
|
||||
*/
|
||||
@NoArgsConstructor
|
||||
@Data
|
||||
public class MallProductAttrInfoModel {
|
||||
|
||||
private String ruleType;
|
||||
|
||||
private List<String>ruleAttrList;
|
||||
|
||||
private Boolean addRuleAttrValButton;
|
||||
|
||||
private Boolean ruleAttrValForm;
|
||||
}
|
|
@ -0,0 +1,101 @@
|
|||
package com.nuyu.product.pojo;
|
||||
|
||||
import lombok.Data;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.muyu.common.core.annotation.Excel;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 111对象 Characters
|
||||
*
|
||||
* @author muyu
|
||||
* @date 2024-05-14
|
||||
*/
|
||||
@Data
|
||||
public class Characters extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 人物ID,主键,自动递增 */
|
||||
private Long characterId;
|
||||
|
||||
private Integer pageSize= 10;
|
||||
|
||||
private Integer pageNum= 1;
|
||||
|
||||
/** 人物姓名,不能为空 */
|
||||
@Excel(name = "人物姓名,不能为空")
|
||||
private String name;
|
||||
|
||||
/** 人物年龄 */
|
||||
@Excel(name = "人物年龄")
|
||||
private Long age;
|
||||
|
||||
/** 所属村庄ID,外键,关联村庄表 */
|
||||
@Excel(name = "所属村庄ID,外键,关联村庄表")
|
||||
private Long villageId;
|
||||
|
||||
public Integer getPageSize() {
|
||||
return pageSize;
|
||||
}
|
||||
|
||||
public void setPageSize(Integer pageSize) {
|
||||
this.pageSize = pageSize;
|
||||
}
|
||||
|
||||
public Integer getPageNum() {
|
||||
return pageNum;
|
||||
}
|
||||
|
||||
public void setPageNum(Integer pageNum) {
|
||||
this.pageNum = pageNum;
|
||||
}
|
||||
|
||||
public void setCharacterId(Long characterId)
|
||||
{
|
||||
this.characterId = characterId;
|
||||
}
|
||||
|
||||
public Long getCharacterId()
|
||||
{
|
||||
return characterId;
|
||||
}
|
||||
public void setName(String name)
|
||||
{
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
public void setAge(Long age)
|
||||
{
|
||||
this.age = age;
|
||||
}
|
||||
|
||||
public Long getAge()
|
||||
{
|
||||
return age;
|
||||
}
|
||||
public void setVillageId(Long villageId)
|
||||
{
|
||||
this.villageId = villageId;
|
||||
}
|
||||
|
||||
public Long getVillageId()
|
||||
{
|
||||
return villageId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("characterId", getCharacterId())
|
||||
.append("name", getName())
|
||||
.append("age", getAge())
|
||||
.append("villageId", getVillageId())
|
||||
.toString();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,109 @@
|
|||
package com.muyu.product.controller;
|
||||
|
||||
import java.util.List;
|
||||
import java.io.IOException;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.muyu.common.core.utils.poi.ExcelUtil;
|
||||
import com.muyu.common.core.web.domain.AjaxResult;
|
||||
import com.muyu.product.service.CharactersService;
|
||||
import com.nuyu.product.domain.MallProductReviewInfo;
|
||||
import com.nuyu.product.pojo.Characters;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.muyu.common.log.annotation.Log;
|
||||
import com.muyu.common.log.enums.BusinessType;
|
||||
import com.muyu.common.security.annotation.RequiresPermissions;
|
||||
|
||||
import com.muyu.common.core.web.controller.BaseController;
|
||||
import com.muyu.common.core.domain.Result;
|
||||
|
||||
import com.muyu.common.core.web.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 111Controller
|
||||
*
|
||||
* @author muyu
|
||||
* @date 2024-05-14
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/naruto")
|
||||
public class CharactersController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private CharactersService charactersService;
|
||||
|
||||
/**
|
||||
* 查询111列表
|
||||
*/
|
||||
@RequiresPermissions("product:naruto:list")
|
||||
@GetMapping("/list")
|
||||
public AjaxResult list(Characters characters){
|
||||
PageInfo<Characters> info=charactersService.list(characters);
|
||||
return AjaxResult.success(info);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出火影忍者列表
|
||||
*/
|
||||
@RequiresPermissions("product:naruto:export")
|
||||
@Log(title = "火影忍者", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, Characters characters)
|
||||
{
|
||||
List<Characters> list = charactersService.selectCharactersList(characters);
|
||||
ExcelUtil<Characters> util = new ExcelUtil<Characters>(Characters.class);
|
||||
util.exportExcel(response, list, "火影忍者数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取111详细信息
|
||||
*/
|
||||
@RequiresPermissions("product:naruto:query")
|
||||
@GetMapping(value = "/{characterId}")
|
||||
public Result getInfo(@PathVariable("characterId") Long characterId)
|
||||
{
|
||||
return success(charactersService.selectCharactersByCharacterId(characterId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增111
|
||||
*/
|
||||
@RequiresPermissions("product:naruto:add")
|
||||
@Log(title = "111", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public Result add(@RequestBody Characters characters)
|
||||
{
|
||||
return toAjax(charactersService.insertCharacters(characters));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改111
|
||||
*/
|
||||
@RequiresPermissions("product:naruto:edit")
|
||||
@Log(title = "111", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public Result edit(@RequestBody Characters characters)
|
||||
{
|
||||
return toAjax(charactersService.updateCharacters(characters));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除111
|
||||
*/
|
||||
@RequiresPermissions("product:naruto:remove")
|
||||
@Log(title = "111", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{characterIds}")
|
||||
public Result remove(@PathVariable Long[] characterIds)
|
||||
{
|
||||
return toAjax(charactersService.deleteCharactersByCharacterIds(characterIds));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,68 @@
|
|||
package com.muyu.product.mapper;
|
||||
|
||||
import com.nuyu.product.pojo.Characters;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* 111Mapper接口
|
||||
*
|
||||
* @author muyu
|
||||
* @date 2024-05-14
|
||||
*/
|
||||
@Mapper
|
||||
public interface CharactersMapper
|
||||
{
|
||||
|
||||
/**
|
||||
* 查询111
|
||||
*
|
||||
* @param characterId 111主键
|
||||
* @return 111
|
||||
*/
|
||||
public Characters selectCharactersByCharacterId(Long characterId);
|
||||
|
||||
/**
|
||||
* 查询111列表
|
||||
*
|
||||
* @param characters 111
|
||||
* @return 111集合
|
||||
*/
|
||||
public List<Characters> selectCharactersList(Characters characters);
|
||||
|
||||
/**
|
||||
* 新增111
|
||||
*
|
||||
* @param characters 111
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertCharacters(Characters characters);
|
||||
|
||||
/**
|
||||
* 修改111
|
||||
*
|
||||
* @param characters 111
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateCharacters(Characters characters);
|
||||
|
||||
/**
|
||||
* 删除111
|
||||
*
|
||||
* @param characterId 111主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteCharactersByCharacterId(Long characterId);
|
||||
|
||||
/**
|
||||
* 批量删除111
|
||||
*
|
||||
* @param characterIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteCharactersByCharacterIds(Long[] characterIds);
|
||||
|
||||
List<Characters> list(Characters characters);
|
||||
}
|
|
@ -3,6 +3,7 @@ package com.muyu.product.mapper;
|
|||
import com.nuyu.product.domain.MallProductRuleAttrInfo;
|
||||
import com.nuyu.product.req.BookReq;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@ -65,4 +66,8 @@ public interface MallProductRuleAttrInfoMapper
|
|||
public int deleteMallProductRuleAttrInfoByIds(Long[] ids);
|
||||
|
||||
List<MallProductRuleAttrInfo> list(MallProductRuleAttrInfo mallProductRuleAttrInfo);
|
||||
|
||||
void deleteMallProductRuleAttrInfByRuleId(@Param("ruleId") Long ruleId);
|
||||
|
||||
void insertMallProductRuleAttrInfoList(@Param("ruleAttrInfoList") List<MallProductRuleAttrInfo> ruleAttrInfoList);
|
||||
}
|
||||
|
|
|
@ -0,0 +1,66 @@
|
|||
package com.muyu.product.service;
|
||||
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.nuyu.product.pojo.Characters;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* 111Service接口
|
||||
*
|
||||
* @author muyu
|
||||
* @date 2024-05-14
|
||||
*/
|
||||
public interface CharactersService
|
||||
{
|
||||
/**
|
||||
* 查询111
|
||||
*
|
||||
* @param characterId 111主键
|
||||
* @return 111
|
||||
*/
|
||||
public Characters selectCharactersByCharacterId(Long characterId);
|
||||
|
||||
/**
|
||||
* 查询111列表
|
||||
*
|
||||
* @param characters 111
|
||||
* @return 111集合
|
||||
*/
|
||||
public List<Characters> selectCharactersList(Characters characters);
|
||||
|
||||
/**
|
||||
* 新增111
|
||||
*
|
||||
* @param characters 111
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertCharacters(Characters characters);
|
||||
|
||||
/**
|
||||
* 修改111
|
||||
*
|
||||
* @param characters 111
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateCharacters(Characters characters);
|
||||
|
||||
/**
|
||||
* 批量删除111
|
||||
*
|
||||
* @param characterIds 需要删除的111主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteCharactersByCharacterIds(Long[] characterIds);
|
||||
|
||||
/**
|
||||
* 删除111信息
|
||||
*
|
||||
* @param characterId 111主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteCharactersByCharacterId(Long characterId);
|
||||
|
||||
PageInfo<Characters> list(Characters characters);
|
||||
}
|
|
@ -0,0 +1,105 @@
|
|||
package com.muyu.product.service.Impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.muyu.product.mapper.CharactersMapper;
|
||||
import com.muyu.product.service.CharactersService;
|
||||
import com.nuyu.product.pojo.Characters;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
|
||||
/**
|
||||
* 111Service业务层处理
|
||||
*
|
||||
* @author muyu
|
||||
* @date 2024-05-14
|
||||
*/
|
||||
@Service
|
||||
public class CharactersServiceImpl implements CharactersService
|
||||
{
|
||||
@Autowired
|
||||
private CharactersMapper charactersMapper;
|
||||
|
||||
/**
|
||||
* 查询111
|
||||
*
|
||||
* @param characterId 111主键
|
||||
* @return 111
|
||||
*/
|
||||
@Override
|
||||
public Characters selectCharactersByCharacterId(Long characterId)
|
||||
{
|
||||
return charactersMapper.selectCharactersByCharacterId(characterId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询111列表
|
||||
*
|
||||
* @param characters 111
|
||||
* @return 111
|
||||
*/
|
||||
@Override
|
||||
public List<Characters> selectCharactersList(Characters characters)
|
||||
{
|
||||
return charactersMapper.selectCharactersList(characters);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增111
|
||||
*
|
||||
* @param characters 111
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertCharacters(Characters characters)
|
||||
{
|
||||
return charactersMapper.insertCharacters(characters);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改111
|
||||
*
|
||||
* @param characters 111
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateCharacters(Characters characters)
|
||||
{
|
||||
return charactersMapper.updateCharacters(characters);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除111
|
||||
*
|
||||
* @param characterIds 需要删除的111主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteCharactersByCharacterIds(Long[] characterIds)
|
||||
{
|
||||
return charactersMapper.deleteCharactersByCharacterIds(characterIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除111信息
|
||||
*
|
||||
* @param characterId 111主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteCharactersByCharacterId(Long characterId)
|
||||
{
|
||||
return charactersMapper.deleteCharactersByCharacterId(characterId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageInfo<Characters> list(Characters characters) {
|
||||
PageHelper.startPage(characters.getPageNum(),characters.getPageSize());
|
||||
List<Characters>list=charactersMapper.list(characters);
|
||||
PageInfo<Characters> pageInfo=new PageInfo<>(list);
|
||||
return pageInfo;
|
||||
}
|
||||
}
|
|
@ -107,4 +107,14 @@ public class MallProductRuleAttrInfoServiceImpl implements MallProductRuleAttrIn
|
|||
PageInfo<MallProductRuleAttrInfo> pageInfo = new PageInfo<>(products);
|
||||
return pageInfo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteMallProductRuleAttrInfByRuleId(Long ruleId) {
|
||||
mallProductRuleAttrInfoMapper.deleteMallProductRuleAttrInfByRuleId(ruleId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void insertMallProductRuleAttrInfoList(List<MallProductRuleAttrInfo> ruleAttrInfoList) {
|
||||
mallProductRuleAttrInfoMapper.insertMallProductRuleAttrInfoList(ruleAttrInfoList);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,18 +1,27 @@
|
|||
package com.muyu.product.service.Impl;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.muyu.common.core.utils.DateUtils;
|
||||
import com.muyu.common.security.utils.SecurityUtils;
|
||||
import com.muyu.common.system.domain.LoginUser;
|
||||
import com.muyu.product.service.MallProductRuleAttrInfoService;
|
||||
import com.muyu.product.service.MallProductRuleInfoService;
|
||||
import com.nuyu.product.domain.MallProductRuleAttrInfo;
|
||||
import com.nuyu.product.domain.MallProductRuleInfo;
|
||||
import com.nuyu.product.domain.MallProductTypeInfo;
|
||||
import com.nuyu.product.model.MallProductAttrInfoModel;
|
||||
import com.nuyu.product.req.BookReq;
|
||||
import lombok.val;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.muyu.product.mapper.MallProductRuleInfoMapper;
|
||||
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
|
||||
/**
|
||||
|
@ -27,6 +36,9 @@ public class MallProductRuleInfoServiceImpl implements MallProductRuleInfoServic
|
|||
@Autowired
|
||||
private MallProductRuleInfoMapper mallProductRuleInfoMapper;
|
||||
|
||||
|
||||
@Autowired
|
||||
private MallProductRuleAttrInfoService mallProductRuleAttrInfoService;
|
||||
/**
|
||||
* 查询商品规格
|
||||
*
|
||||
|
@ -57,11 +69,43 @@ public class MallProductRuleInfoServiceImpl implements MallProductRuleInfoServic
|
|||
* @param mallProductRuleInfo 商品规格
|
||||
* @return 结果
|
||||
*/
|
||||
@Transactional
|
||||
@Override
|
||||
public int insertMallProductRuleInfo(MallProductRuleInfo mallProductRuleInfo)
|
||||
{
|
||||
Long userId = SecurityUtils.getLoginUser().getUserid();
|
||||
mallProductRuleInfo.setCreateBy(userId.toString());
|
||||
Long loginUserId = SecurityUtils.getLoginUser().getUserid();
|
||||
mallProductRuleInfo.setUpdateBy(loginUserId.toString());
|
||||
|
||||
mallProductRuleInfo.setUpdateTime(DateUtils.getNowDate());
|
||||
mallProductRuleInfo.setCreateTime(DateUtils.getNowDate());
|
||||
return mallProductRuleInfoMapper.insertMallProductRuleInfo(mallProductRuleInfo);
|
||||
int i = mallProductRuleInfoMapper.insertMallProductRuleInfo(mallProductRuleInfo);
|
||||
if(i > 0){
|
||||
Long ruleId = mallProductRuleInfo.getId();
|
||||
String ruleAttr = mallProductRuleInfo.getRuleAttr();
|
||||
List<MallProductRuleAttrInfo>ruleAttrInfoList = new ArrayList<>();
|
||||
List<MallProductAttrInfoModel>mallProductAttrInfoModels= JSON.parseArray(ruleAttr, MallProductAttrInfoModel.class);
|
||||
if(CollectionUtils.isNotEmpty(mallProductAttrInfoModels)){
|
||||
for(MallProductAttrInfoModel mallProductAttrInfoModel : mallProductAttrInfoModels){
|
||||
String ruleType = mallProductAttrInfoModel.getRuleType();
|
||||
List<String> ruleAttrList= mallProductAttrInfoModel.getRuleAttrList();
|
||||
for (String ruleAttrString : ruleAttrList) {
|
||||
MallProductRuleAttrInfo mallProductRuleAttrInfo = new MallProductRuleAttrInfo();
|
||||
mallProductRuleAttrInfo.setAttrValue(ruleAttrString);
|
||||
mallProductRuleAttrInfo.setName(ruleType);
|
||||
mallProductRuleAttrInfo.setRuleId(ruleId);
|
||||
ruleAttrInfoList.add(mallProductRuleAttrInfo);
|
||||
}
|
||||
}
|
||||
mallProductRuleAttrInfoService.deleteMallProductRuleAttrInfByRuleId(ruleId);
|
||||
mallProductRuleAttrInfoService.insertMallProductRuleAttrInfoList(ruleAttrInfoList);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
return i;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -65,4 +65,9 @@ public interface MallProductRuleAttrInfoService
|
|||
public int deleteMallProductRuleAttrInfoById(Long id);
|
||||
|
||||
PageInfo<MallProductRuleAttrInfo> list(MallProductRuleAttrInfo mallProductRuleAttrInfo);
|
||||
|
||||
|
||||
void deleteMallProductRuleAttrInfByRuleId(Long ruleId);
|
||||
|
||||
void insertMallProductRuleAttrInfoList(List<MallProductRuleAttrInfo> ruleAttrInfoList);
|
||||
}
|
||||
|
|
|
@ -0,0 +1,76 @@
|
|||
<?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.muyu.product.mapper.CharactersMapper">
|
||||
|
||||
<resultMap type="com.nuyu.product.pojo.Characters" id="CharactersResult">
|
||||
<result property="characterId" column="character_id" />
|
||||
<result property="name" column="name" />
|
||||
<result property="age" column="age" />
|
||||
<result property="villageId" column="village_id" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectCharactersVo">
|
||||
select character_id, name, age, village_id from Characters
|
||||
</sql>
|
||||
|
||||
<select id="selectCharactersList" parameterType="com.nuyu.product.pojo.Characters" resultMap="CharactersResult">
|
||||
<include refid="selectCharactersVo"/>
|
||||
<where>
|
||||
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
||||
<if test="age != null "> and age = #{age}</if>
|
||||
<if test="villageId != null "> and village_id = #{villageId}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectCharactersByCharacterId" parameterType="Long" resultMap="CharactersResult">
|
||||
<include refid="selectCharactersVo"/>
|
||||
where character_id = #{characterId}
|
||||
</select>
|
||||
|
||||
<select id="list" resultType="com.nuyu.product.pojo.Characters">
|
||||
<include refid="selectCharactersVo"/>
|
||||
<where>
|
||||
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
||||
<if test="age != null "> and age = #{age}</if>
|
||||
<if test="villageId != null "> and village_id = #{villageId}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<insert id="insertCharacters" parameterType="com.nuyu.product.pojo.Characters" useGeneratedKeys="true" keyProperty="characterId">
|
||||
insert into Characters
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="name != null and name != ''">name,</if>
|
||||
<if test="age != null">age,</if>
|
||||
<if test="villageId != null">village_id,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="name != null and name != ''">#{name},</if>
|
||||
<if test="age != null">#{age},</if>
|
||||
<if test="villageId != null">#{villageId},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateCharacters" parameterType="com.nuyu.product.pojo.Characters">
|
||||
update Characters
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="name != null and name != ''">name = #{name},</if>
|
||||
<if test="age != null">age = #{age},</if>
|
||||
<if test="villageId != null">village_id = #{villageId},</if>
|
||||
</trim>
|
||||
where character_id = #{characterId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteCharactersByCharacterId" parameterType="Long">
|
||||
delete from Characters where character_id = #{characterId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteCharactersByCharacterIds" parameterType="String">
|
||||
delete from Characters where character_id in
|
||||
<foreach item="characterId" collection="array" open="(" separator="," close=")">
|
||||
#{characterId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
|
@ -69,6 +69,33 @@
|
|||
</trim>
|
||||
</insert>
|
||||
|
||||
|
||||
<insert id="insertMallProductRuleAttrInfoList" parameterType="java.util.List">
|
||||
<foreach collection="ruleAttrInfoList" item="item" separator=";">
|
||||
insert into mall_product_rule_attr_info
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="item.ruleId != null">rule_id,</if>
|
||||
<if test="item.name != null">name,</if>
|
||||
<if test="item.attrValue != null">attr_value,</if>
|
||||
<if test="item.revision != null">revision,</if>
|
||||
<if test="item.createBy != null">create_by,</if>
|
||||
<if test="item.createTime != null">create_time,</if>
|
||||
<if test="item.updateBy != null">update_by,</if>
|
||||
<if test="item.updateTime != null">update_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="item.ruleId != null">#{item.ruleId},</if>
|
||||
<if test="item.name != null">#{item.name},</if>
|
||||
<if test="item.attrValue != null">#{item.attrValue},</if>
|
||||
<if test="item.revision != null">#{item.revision},</if>
|
||||
<if test="item.createBy != null">#{item.createBy},</if>
|
||||
<if test="item.createTime != null">#{item.createTime},</if>
|
||||
<if test="item.updateBy != null">#{item.updateBy},</if>
|
||||
<if test="item.updateTime != null">#{item.updateTime},</if>
|
||||
</trim>
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<update id="updateMallProductRuleAttrInfo" parameterType="com.nuyu.product.domain.MallProductRuleAttrInfo">
|
||||
update mall_product_rule_attr_info
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
|
@ -94,4 +121,8 @@
|
|||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<delete id="deleteMallProductRuleAttrInfByRuleId" parameterType="java.lang.Long">
|
||||
delete from mall_product_rule_attr_info where rule_id = #{ruleId}
|
||||
</delete>
|
||||
</mapper>
|
||||
|
|
Loading…
Reference in New Issue