This commit is contained in:
GeDashi 2024-12-20 01:47:50 +08:00
parent 6d12ce486d
commit 4df60be99f
13 changed files with 1045 additions and 1 deletions

View File

@ -176,6 +176,6 @@ public class SysLoginService
sysUser.setUserId(userId);
sysUser.setLoginIp(IpUtils.getIpAddr());
sysUser.setLoginDate(DateUtils.getNowDate());
userService.updateUserProfile(sysUser);
//userService.updateUserProfile(sysUser);
}
}

View File

@ -0,0 +1,104 @@
package com.ruoyi.system.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
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.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.system.domain.Customer;
import com.ruoyi.system.service.ICustomerService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* 客户表Controller
*
* @author LG
* @date 2024-12-20
*/
@RestController
@RequestMapping("/system/customer")
public class CustomerController extends BaseController
{
@Autowired
private ICustomerService customerService;
/**
* 查询客户表列表
*/
@PreAuthorize("@ss.hasPermi('system:customer:list')")
@GetMapping("/list")
public TableDataInfo list(Customer customer)
{
startPage();
List<Customer> list = customerService.selectCustomerList(customer);
return getDataTable(list);
}
/**
* 导出客户表列表
*/
@PreAuthorize("@ss.hasPermi('system:customer:export')")
@Log(title = "客户表", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, Customer customer)
{
List<Customer> list = customerService.selectCustomerList(customer);
ExcelUtil<Customer> util = new ExcelUtil<Customer>(Customer.class);
util.exportExcel(response, list, "客户表数据");
}
/**
* 获取客户表详细信息
*/
@PreAuthorize("@ss.hasPermi('system:customer:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(customerService.selectCustomerById(id));
}
/**
* 新增客户表
*/
@PreAuthorize("@ss.hasPermi('system:customer:add')")
@Log(title = "客户表", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody Customer customer)
{
return toAjax(customerService.insertCustomer(customer));
}
/**
* 修改客户表
*/
@PreAuthorize("@ss.hasPermi('system:customer:edit')")
@Log(title = "客户表", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody Customer customer)
{
return toAjax(customerService.updateCustomer(customer));
}
/**
* 删除客户表
*/
@PreAuthorize("@ss.hasPermi('system:customer:remove')")
@Log(title = "客户表", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(customerService.deleteCustomerByIds(ids));
}
}

View File

@ -0,0 +1,104 @@
package com.ruoyi.system.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
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.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.system.domain.Twodimension;
import com.ruoyi.system.service.ITwodimensionService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* 提货二维码Controller
*
* @author LG
* @date 2024-12-20
*/
@RestController
@RequestMapping("/system/twodimension")
public class TwodimensionController extends BaseController
{
@Autowired
private ITwodimensionService twodimensionService;
/**
* 查询提货二维码列表
*/
@PreAuthorize("@ss.hasPermi('system:twodimension:list')")
@GetMapping("/list")
public TableDataInfo list(Twodimension twodimension)
{
startPage();
List<Twodimension> list = twodimensionService.selectTwodimensionList(twodimension);
return getDataTable(list);
}
/**
* 导出提货二维码列表
*/
@PreAuthorize("@ss.hasPermi('system:twodimension:export')")
@Log(title = "提货二维码", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, Twodimension twodimension)
{
List<Twodimension> list = twodimensionService.selectTwodimensionList(twodimension);
ExcelUtil<Twodimension> util = new ExcelUtil<Twodimension>(Twodimension.class);
util.exportExcel(response, list, "提货二维码数据");
}
/**
* 获取提货二维码详细信息
*/
@PreAuthorize("@ss.hasPermi('system:twodimension:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(twodimensionService.selectTwodimensionById(id));
}
/**
* 新增提货二维码
*/
@PreAuthorize("@ss.hasPermi('system:twodimension:add')")
@Log(title = "提货二维码", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody Twodimension twodimension)
{
return toAjax(twodimensionService.insertTwodimension(twodimension));
}
/**
* 修改提货二维码
*/
@PreAuthorize("@ss.hasPermi('system:twodimension:edit')")
@Log(title = "提货二维码", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody Twodimension twodimension)
{
return toAjax(twodimensionService.updateTwodimension(twodimension));
}
/**
* 删除提货二维码
*/
@PreAuthorize("@ss.hasPermi('system:twodimension:remove')")
@Log(title = "提货二维码", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(twodimensionService.deleteTwodimensionByIds(ids));
}
}

View File

@ -0,0 +1,80 @@
package com.ruoyi.system.domain;
import java.util.List;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
/**
* 客户表对象 customer
*
* @author LG
* @date 2024-12-20
*/
public class Customer extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 客户id */
private Long id;
/** 客户名 */
@Excel(name = "客户名")
private String customername;
/** 二维码id */
@Excel(name = "二维码id")
private Long twodimensionid;
/** 提货二维码信息 */
private List<Twodimension> twodimensionList;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setCustomername(String customername)
{
this.customername = customername;
}
public String getCustomername()
{
return customername;
}
public void setTwodimensionid(Long twodimensionid)
{
this.twodimensionid = twodimensionid;
}
public Long getTwodimensionid()
{
return twodimensionid;
}
public List<Twodimension> getTwodimensionList()
{
return twodimensionList;
}
public void setTwodimensionList(List<Twodimension> twodimensionList)
{
this.twodimensionList = twodimensionList;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("customername", getCustomername())
.append("twodimensionid", getTwodimensionid())
.append("twodimensionList", getTwodimensionList())
.toString();
}
}

View File

@ -0,0 +1,93 @@
package com.ruoyi.system.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
/**
* 提货二维码对象 twodimension
*
* @author LG
* @date 2024-12-20
*/
public class Twodimension extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 二维码id */
private Long id;
/** 二维码1 */
@Excel(name = "二维码1")
private String twodimension1;
/** 二维码2 */
@Excel(name = " 二维码2")
private String twodimension2;
/** 二维码3 */
@Excel(name = " 二维码3")
private String twodimension3;
/** 客户id */
@Excel(name = "客户id")
private Long customerid;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setTwodimension1(String twodimension1)
{
this.twodimension1 = twodimension1;
}
public String getTwodimension1()
{
return twodimension1;
}
public void setTwodimension2(String twodimension2)
{
this.twodimension2 = twodimension2;
}
public String getTwodimension2()
{
return twodimension2;
}
public void setTwodimension3(String twodimension3)
{
this.twodimension3 = twodimension3;
}
public String getTwodimension3()
{
return twodimension3;
}
public void setCustomerid(Long customerid)
{
this.customerid = customerid;
}
public Long getCustomerid()
{
return customerid;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("twodimension1", getTwodimension1())
.append("twodimension2", getTwodimension2())
.append("twodimension3", getTwodimension3())
.append("customerid", getCustomerid())
.toString();
}
}

View File

@ -0,0 +1,87 @@
package com.ruoyi.system.mapper;
import java.util.List;
import com.ruoyi.system.domain.Customer;
import com.ruoyi.system.domain.Twodimension;
/**
* 客户表Mapper接口
*
* @author LG
* @date 2024-12-20
*/
public interface CustomerMapper
{
/**
* 查询客户表
*
* @param id 客户表主键
* @return 客户表
*/
public Customer selectCustomerById(Long id);
/**
* 查询客户表列表
*
* @param customer 客户表
* @return 客户表集合
*/
public List<Customer> selectCustomerList(Customer customer);
/**
* 新增客户表
*
* @param customer 客户表
* @return 结果
*/
public int insertCustomer(Customer customer);
/**
* 修改客户表
*
* @param customer 客户表
* @return 结果
*/
public int updateCustomer(Customer customer);
/**
* 删除客户表
*
* @param id 客户表主键
* @return 结果
*/
public int deleteCustomerById(Long id);
/**
* 批量删除客户表
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteCustomerByIds(Long[] ids);
/**
* 批量删除提货二维码
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteTwodimensionByCustomerids(Long[] ids);
/**
* 批量新增提货二维码
*
* @param twodimensionList 提货二维码列表
* @return 结果
*/
public int batchTwodimension(List<Twodimension> twodimensionList);
/**
* 通过客户表主键删除提货二维码信息
*
* @param id 客户表ID
* @return 结果
*/
public int deleteTwodimensionByCustomerid(Long id);
}

View File

@ -0,0 +1,61 @@
package com.ruoyi.system.mapper;
import java.util.List;
import com.ruoyi.system.domain.Twodimension;
/**
* 提货二维码Mapper接口
*
* @author LG
* @date 2024-12-20
*/
public interface TwodimensionMapper
{
/**
* 查询提货二维码
*
* @param id 提货二维码主键
* @return 提货二维码
*/
public Twodimension selectTwodimensionById(Long id);
/**
* 查询提货二维码列表
*
* @param twodimension 提货二维码
* @return 提货二维码集合
*/
public List<Twodimension> selectTwodimensionList(Twodimension twodimension);
/**
* 新增提货二维码
*
* @param twodimension 提货二维码
* @return 结果
*/
public int insertTwodimension(Twodimension twodimension);
/**
* 修改提货二维码
*
* @param twodimension 提货二维码
* @return 结果
*/
public int updateTwodimension(Twodimension twodimension);
/**
* 删除提货二维码
*
* @param id 提货二维码主键
* @return 结果
*/
public int deleteTwodimensionById(Long id);
/**
* 批量删除提货二维码
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteTwodimensionByIds(Long[] ids);
}

View File

@ -0,0 +1,61 @@
package com.ruoyi.system.service;
import java.util.List;
import com.ruoyi.system.domain.Customer;
/**
* 客户表Service接口
*
* @author LG
* @date 2024-12-20
*/
public interface ICustomerService
{
/**
* 查询客户表
*
* @param id 客户表主键
* @return 客户表
*/
public Customer selectCustomerById(Long id);
/**
* 查询客户表列表
*
* @param customer 客户表
* @return 客户表集合
*/
public List<Customer> selectCustomerList(Customer customer);
/**
* 新增客户表
*
* @param customer 客户表
* @return 结果
*/
public int insertCustomer(Customer customer);
/**
* 修改客户表
*
* @param customer 客户表
* @return 结果
*/
public int updateCustomer(Customer customer);
/**
* 批量删除客户表
*
* @param ids 需要删除的客户表主键集合
* @return 结果
*/
public int deleteCustomerByIds(Long[] ids);
/**
* 删除客户表信息
*
* @param id 客户表主键
* @return 结果
*/
public int deleteCustomerById(Long id);
}

View File

@ -0,0 +1,61 @@
package com.ruoyi.system.service;
import java.util.List;
import com.ruoyi.system.domain.Twodimension;
/**
* 提货二维码Service接口
*
* @author LG
* @date 2024-12-20
*/
public interface ITwodimensionService
{
/**
* 查询提货二维码
*
* @param id 提货二维码主键
* @return 提货二维码
*/
public Twodimension selectTwodimensionById(Long id);
/**
* 查询提货二维码列表
*
* @param twodimension 提货二维码
* @return 提货二维码集合
*/
public List<Twodimension> selectTwodimensionList(Twodimension twodimension);
/**
* 新增提货二维码
*
* @param twodimension 提货二维码
* @return 结果
*/
public int insertTwodimension(Twodimension twodimension);
/**
* 修改提货二维码
*
* @param twodimension 提货二维码
* @return 结果
*/
public int updateTwodimension(Twodimension twodimension);
/**
* 批量删除提货二维码
*
* @param ids 需要删除的提货二维码主键集合
* @return 结果
*/
public int deleteTwodimensionByIds(Long[] ids);
/**
* 删除提货二维码信息
*
* @param id 提货二维码主键
* @return 结果
*/
public int deleteTwodimensionById(Long id);
}

View File

@ -0,0 +1,131 @@
package com.ruoyi.system.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import com.ruoyi.common.utils.StringUtils;
import org.springframework.transaction.annotation.Transactional;
import com.ruoyi.system.domain.Twodimension;
import com.ruoyi.system.mapper.CustomerMapper;
import com.ruoyi.system.domain.Customer;
import com.ruoyi.system.service.ICustomerService;
/**
* 客户表Service业务层处理
*
* @author LG
* @date 2024-12-20
*/
@Service
public class CustomerServiceImpl implements ICustomerService
{
@Autowired
private CustomerMapper customerMapper;
/**
* 查询客户表
*
* @param id 客户表主键
* @return 客户表
*/
@Override
public Customer selectCustomerById(Long id)
{
return customerMapper.selectCustomerById(id);
}
/**
* 查询客户表列表
*
* @param customer 客户表
* @return 客户表
*/
@Override
public List<Customer> selectCustomerList(Customer customer)
{
return customerMapper.selectCustomerList(customer);
}
/**
* 新增客户表
*
* @param customer 客户表
* @return 结果
*/
@Transactional
@Override
public int insertCustomer(Customer customer)
{
int rows = customerMapper.insertCustomer(customer);
insertTwodimension(customer);
return rows;
}
/**
* 修改客户表
*
* @param customer 客户表
* @return 结果
*/
@Transactional
@Override
public int updateCustomer(Customer customer)
{
customerMapper.deleteTwodimensionByCustomerid(customer.getId());
insertTwodimension(customer);
return customerMapper.updateCustomer(customer);
}
/**
* 批量删除客户表
*
* @param ids 需要删除的客户表主键
* @return 结果
*/
@Transactional
@Override
public int deleteCustomerByIds(Long[] ids)
{
customerMapper.deleteTwodimensionByCustomerids(ids);
return customerMapper.deleteCustomerByIds(ids);
}
/**
* 删除客户表信息
*
* @param id 客户表主键
* @return 结果
*/
@Transactional
@Override
public int deleteCustomerById(Long id)
{
customerMapper.deleteTwodimensionByCustomerid(id);
return customerMapper.deleteCustomerById(id);
}
/**
* 新增提货二维码信息
*
* @param customer 客户表对象
*/
public void insertTwodimension(Customer customer)
{
List<Twodimension> twodimensionList = customer.getTwodimensionList();
Long id = customer.getId();
if (StringUtils.isNotNull(twodimensionList))
{
List<Twodimension> list = new ArrayList<Twodimension>();
for (Twodimension twodimension : twodimensionList)
{
twodimension.setCustomerid(id);
list.add(twodimension);
}
if (list.size() > 0)
{
customerMapper.batchTwodimension(list);
}
}
}
}

View File

@ -0,0 +1,93 @@
package com.ruoyi.system.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.TwodimensionMapper;
import com.ruoyi.system.domain.Twodimension;
import com.ruoyi.system.service.ITwodimensionService;
/**
* 提货二维码Service业务层处理
*
* @author LG
* @date 2024-12-20
*/
@Service
public class TwodimensionServiceImpl implements ITwodimensionService
{
@Autowired
private TwodimensionMapper twodimensionMapper;
/**
* 查询提货二维码
*
* @param id 提货二维码主键
* @return 提货二维码
*/
@Override
public Twodimension selectTwodimensionById(Long id)
{
return twodimensionMapper.selectTwodimensionById(id);
}
/**
* 查询提货二维码列表
*
* @param twodimension 提货二维码
* @return 提货二维码
*/
@Override
public List<Twodimension> selectTwodimensionList(Twodimension twodimension)
{
return twodimensionMapper.selectTwodimensionList(twodimension);
}
/**
* 新增提货二维码
*
* @param twodimension 提货二维码
* @return 结果
*/
@Override
public int insertTwodimension(Twodimension twodimension)
{
return twodimensionMapper.insertTwodimension(twodimension);
}
/**
* 修改提货二维码
*
* @param twodimension 提货二维码
* @return 结果
*/
@Override
public int updateTwodimension(Twodimension twodimension)
{
return twodimensionMapper.updateTwodimension(twodimension);
}
/**
* 批量删除提货二维码
*
* @param ids 需要删除的提货二维码主键
* @return 结果
*/
@Override
public int deleteTwodimensionByIds(Long[] ids)
{
return twodimensionMapper.deleteTwodimensionByIds(ids);
}
/**
* 删除提货二维码信息
*
* @param id 提货二维码主键
* @return 结果
*/
@Override
public int deleteTwodimensionById(Long id)
{
return twodimensionMapper.deleteTwodimensionById(id);
}
}

View File

@ -0,0 +1,98 @@
<?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.ruoyi.system.mapper.CustomerMapper">
<resultMap type="Customer" id="CustomerResult">
<result property="id" column="id" />
<result property="customername" column="customername" />
<result property="twodimensionid" column="twodimensionid" />
</resultMap>
<resultMap id="CustomerTwodimensionResult" type="Customer" extends="CustomerResult">
<collection property="twodimensionList" ofType="Twodimension" column="id" select="selectTwodimensionList" />
</resultMap>
<resultMap type="Twodimension" id="TwodimensionResult">
<result property="id" column="id" />
<result property="twodimension1" column="twodimension1" />
<result property="twodimension2" column="twodimension2" />
<result property="twodimension3" column="twodimension3" />
<result property="customerid" column="customerid" />
</resultMap>
<sql id="selectCustomerVo">
select id, customername, twodimensionid from customer
</sql>
<select id="selectCustomerList" parameterType="Customer" resultMap="CustomerResult">
<include refid="selectCustomerVo"/>
<where>
<if test="customername != null and customername != ''"> and customername like concat('%', #{customername}, '%')</if>
<if test="twodimensionid != null "> and twodimensionid = #{twodimensionid}</if>
</where>
</select>
<select id="selectCustomerById" parameterType="Long" resultMap="CustomerTwodimensionResult">
select id, customername, twodimensionid
from customer
where id = #{id}
</select>
<select id="selectTwodimensionList" resultMap="TwodimensionResult">
select id, twodimension1, twodimension2, twodimension3, customerid
from twodimension
where customerid = #{customerid}
</select>
<insert id="insertCustomer" parameterType="Customer" useGeneratedKeys="true" keyProperty="id">
insert into customer
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="customername != null">customername,</if>
<if test="twodimensionid != null">twodimensionid,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="customername != null">#{customername},</if>
<if test="twodimensionid != null">#{twodimensionid},</if>
</trim>
</insert>
<update id="updateCustomer" parameterType="Customer">
update customer
<trim prefix="SET" suffixOverrides=",">
<if test="customername != null">customername = #{customername},</if>
<if test="twodimensionid != null">twodimensionid = #{twodimensionid},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteCustomerById" parameterType="Long">
delete from customer where id = #{id}
</delete>
<delete id="deleteCustomerByIds" parameterType="String">
delete from customer where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<delete id="deleteTwodimensionByCustomerids" parameterType="String">
delete from twodimension where customerid in
<foreach item="customerid" collection="array" open="(" separator="," close=")">
#{customerid}
</foreach>
</delete>
<delete id="deleteTwodimensionByCustomerid" parameterType="Long">
delete from twodimension where customerid = #{customerid}
</delete>
<insert id="batchTwodimension">
insert into twodimension( id, twodimension1, twodimension2, twodimension3, customerid) values
<foreach item="item" index="index" collection="list" separator=",">
( #{item.id}, #{item.twodimension1}, #{item.twodimension2}, #{item.twodimension3}, #{item.customerid})
</foreach>
</insert>
</mapper>

View File

@ -0,0 +1,71 @@
<?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.ruoyi.system.mapper.TwodimensionMapper">
<resultMap type="Twodimension" id="TwodimensionResult">
<result property="id" column="id" />
<result property="twodimension1" column="twodimension1" />
<result property="twodimension2" column="twodimension2" />
<result property="twodimension3" column="twodimension3" />
<result property="customerid" column="customerid" />
</resultMap>
<sql id="selectTwodimensionVo">
select id, twodimension1, twodimension2, twodimension3, customerid from twodimension
</sql>
<select id="selectTwodimensionList" parameterType="Twodimension" resultMap="TwodimensionResult">
<include refid="selectTwodimensionVo"/>
<where>
<if test="twodimension1 != null and twodimension1 != ''"> and twodimension1 = #{twodimension1}</if>
<if test="twodimension2 != null and twodimension2 != ''"> and twodimension2 = #{twodimension2}</if>
<if test="twodimension3 != null and twodimension3 != ''"> and twodimension3 = #{twodimension3}</if>
<if test="customerid != null "> and customerid = #{customerid}</if>
</where>
</select>
<select id="selectTwodimensionById" parameterType="Long" resultMap="TwodimensionResult">
<include refid="selectTwodimensionVo"/>
where id = #{id}
</select>
<insert id="insertTwodimension" parameterType="Twodimension" useGeneratedKeys="true" keyProperty="id">
insert into twodimension
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="twodimension1 != null">twodimension1,</if>
<if test="twodimension2 != null">twodimension2,</if>
<if test="twodimension3 != null">twodimension3,</if>
<if test="customerid != null">customerid,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="twodimension1 != null">#{twodimension1},</if>
<if test="twodimension2 != null">#{twodimension2},</if>
<if test="twodimension3 != null">#{twodimension3},</if>
<if test="customerid != null">#{customerid},</if>
</trim>
</insert>
<update id="updateTwodimension" parameterType="Twodimension">
update twodimension
<trim prefix="SET" suffixOverrides=",">
<if test="twodimension1 != null">twodimension1 = #{twodimension1},</if>
<if test="twodimension2 != null">twodimension2 = #{twodimension2},</if>
<if test="twodimension3 != null">twodimension3 = #{twodimension3},</if>
<if test="customerid != null">customerid = #{customerid},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteTwodimensionById" parameterType="Long">
delete from twodimension where id = #{id}
</delete>
<delete id="deleteTwodimensionByIds" parameterType="String">
delete from twodimension where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>