zhanghl
2025-04-15 1eaa7387085a2bc0f434ba46eb2d61991d42cd3e
工厂 车间管理
已修改6个文件
已添加6个文件
580 ■■■■■ 文件已修改
aps-common/aps-common-core/src/main/java/com/aps/common/core/utils/uuid/IdUtils.java 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
aps-modules/aps-core/src/main/java/com/aps/core/controller/basicData/ApsPlantController.java 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
aps-modules/aps-core/src/main/java/com/aps/core/controller/basicData/ApsShopController.java 98 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
aps-modules/aps-core/src/main/java/com/aps/core/domain/ApsShop.java 101 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
aps-modules/aps-core/src/main/java/com/aps/core/mapper/ApsPlantMapper.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
aps-modules/aps-core/src/main/java/com/aps/core/mapper/ApsShopMapper.java 63 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
aps-modules/aps-core/src/main/java/com/aps/core/service/IApsPlantService.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
aps-modules/aps-core/src/main/java/com/aps/core/service/IApsShopService.java 61 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
aps-modules/aps-core/src/main/java/com/aps/core/service/impl/ApsPlantServiceImpl.java 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
aps-modules/aps-core/src/main/java/com/aps/core/service/impl/ApsShopServiceImpl.java 100 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
aps-modules/aps-core/src/main/resources/mapper/core/ApsPlantMapper.xml 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
aps-modules/aps-core/src/main/resources/mapper/core/ApsShopMapper.xml 89 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
aps-common/aps-common-core/src/main/java/com/aps/common/core/utils/uuid/IdUtils.java
@@ -1,5 +1,9 @@
package com.aps.common.core.utils.uuid;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.concurrent.atomic.AtomicLong;
/**
 * ID生成器工具类
 * 
@@ -46,4 +50,24 @@
    {
        return UUID.fastUUID().toString(true);
    }
    private static AtomicLong id;
    /**
     * ç”ŸæˆLong ç±»åž‹å”¯ä¸€ID
     */
    public synchronized static Long getId() {
        //如果需要更长 æˆ–者更大冗余空间, åªéœ€è¦ time * 10^n   å³å¯
        //当前可保证1毫秒 ç”Ÿæˆ 10000条不重复
        Long time = Long.valueOf(new SimpleDateFormat("yyyyMMddHHmmssSSS").format(new Date()))*10000;
        if (id == null) {
            id = new AtomicLong(time);
            return id.get();
        }
        if (time <= id.get()) {
            id.addAndGet(1);
        } else {
            id = new AtomicLong(time);
        }
        return id.get();
    }
}
aps-modules/aps-core/src/main/java/com/aps/core/controller/basicData/ApsPlantController.java
@@ -31,7 +31,7 @@
    /**
     * æŸ¥è¯¢å·¥åŽ‚ç®¡ç†åˆ—è¡¨
     */
    @RequiresPermissions("aps_plant:list")
    @RequiresPermissions("plant:list")
    @GetMapping("/list")
    public TableDataInfo list(ApsPlant apsPlant)
    {
@@ -43,7 +43,7 @@
    /**
     * å¯¼å‡ºå·¥åŽ‚ç®¡ç†åˆ—è¡¨
     */
    @RequiresPermissions("aps_plant:export")
    @RequiresPermissions("plant:export")
    @Log(title = "工厂管理", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, ApsPlant apsPlant)
@@ -56,9 +56,9 @@
    /**
     * èŽ·å–å·¥åŽ‚ç®¡ç†è¯¦ç»†ä¿¡æ¯
     */
    @RequiresPermissions("aps_plant:query")
    @RequiresPermissions("plant:query")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id)
    public AjaxResult getInfo(@PathVariable("id") String id)
    {
        return success(apsPlantService.selectApsPlantById(id));
    }
@@ -66,7 +66,7 @@
    /**
     * æ–°å¢žå·¥åŽ‚ç®¡ç†
     */
    @RequiresPermissions("aps_plant:add")
    @RequiresPermissions("plant:add")
    @Log(title = "工厂管理", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody ApsPlant apsPlant)
@@ -77,7 +77,7 @@
    /**
     * ä¿®æ”¹å·¥åŽ‚ç®¡ç†
     */
    @RequiresPermissions("aps_plant:edit")
    @RequiresPermissions("plant:edit")
    @Log(title = "工厂管理", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody ApsPlant apsPlant)
@@ -88,10 +88,10 @@
    /**
     * åˆ é™¤å·¥åŽ‚ç®¡ç†
     */
    @RequiresPermissions("aps_plant:remove")
    @RequiresPermissions("plant:remove")
    @Log(title = "工厂管理", businessType = BusinessType.DELETE)
    @DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids)
    public AjaxResult remove(@PathVariable String[] ids)
    {
        return toAjax(apsPlantService.deleteApsPlantByIds(ids));
    }
aps-modules/aps-core/src/main/java/com/aps/core/controller/basicData/ApsShopController.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,98 @@
package com.aps.core.controller.basicData;
import com.aps.common.core.utils.poi.ExcelUtil;
import com.aps.common.core.web.controller.BaseController;
import com.aps.common.core.web.domain.AjaxResult;
import com.aps.common.core.web.page.TableDataInfo;
import com.aps.common.log.annotation.Log;
import com.aps.common.log.enums.BusinessType;
import com.aps.common.security.annotation.RequiresPermissions;
import com.aps.core.domain.ApsShop;
import com.aps.core.service.IApsShopService;
import jakarta.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
 * è½¦é—´Controller
 *
 * @author ruoyi
 * @date 2025-04-14
 */
@RestController
@RequestMapping("/aps_shop")
public class ApsShopController extends BaseController
{
    @Autowired
    private IApsShopService apsShopService;
    /**
     * æŸ¥è¯¢è½¦é—´åˆ—表
     */
    @RequiresPermissions("shop:list")
    @GetMapping("/list")
    public TableDataInfo list(ApsShop apsShop)
    {
        startPage();
        List<ApsShop> list = apsShopService.selectApsShopList(apsShop);
        return getDataTable(list);
    }
    /**
     * å¯¼å‡ºè½¦é—´åˆ—表
     */
    @RequiresPermissions("shop:export")
    @Log(title = "车间", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, ApsShop apsShop)
    {
        List<ApsShop> list = apsShopService.selectApsShopList(apsShop);
        ExcelUtil<ApsShop> util = new ExcelUtil<ApsShop>(ApsShop.class);
        util.exportExcel(response, list, "车间数据");
    }
    /**
     * èŽ·å–è½¦é—´è¯¦ç»†ä¿¡æ¯
     */
    @RequiresPermissions("shop:query")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") String id)
    {
        return success(apsShopService.selectApsShopById(id));
    }
    /**
     * æ–°å¢žè½¦é—´
     */
    @RequiresPermissions("shop:add")
    @Log(title = "车间", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody ApsShop apsShop)
    {
        return toAjax(apsShopService.insertApsShop(apsShop));
    }
    /**
     * ä¿®æ”¹è½¦é—´
     */
    @RequiresPermissions("shop:edit")
    @Log(title = "车间", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody ApsShop apsShop)
    {
        return toAjax(apsShopService.updateApsShop(apsShop));
    }
    /**
     * åˆ é™¤è½¦é—´
     */
    @RequiresPermissions("shop:remove")
    @Log(title = "车间", businessType = BusinessType.DELETE)
    @DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable String[] ids)
    {
        return toAjax(apsShopService.deleteApsShopByIds(ids));
    }
}
aps-modules/aps-core/src/main/java/com/aps/core/domain/ApsShop.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,101 @@
package com.aps.core.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.aps.common.core.annotation.Excel;
import com.aps.common.core.web.domain.BaseEntity;
/**
 * è½¦é—´å¯¹è±¡ aps_shop
 *
 * @author ruoyi
 * @date 2025-04-14
 */
public class ApsShop extends BaseEntity
{
    private static final long serialVersionUID = 1L;
    /** id */
    private String id;
    /** è½¦é—´åç§° */
    @Excel(name = "车间名称")
    private String shopName;
    /** è½¦é—´ä»£ç  */
    @Excel(name = "车间代码")
    private String shopCode;
    /** å·¥åŽ‚ä»£ç  */
    @Excel(name = "工厂代码")
    private String plantCode;
    /** å¯ç”¨çŠ¶æ€ */
    @Excel(name = "启用状态")
    private String status;
    public void setId(String id)
    {
        this.id = id;
    }
    public String getId()
    {
        return id;
    }
    public void setShopName(String shopName)
    {
        this.shopName = shopName;
    }
    public String getShopName()
    {
        return shopName;
    }
    public void setShopCode(String shopCode)
    {
        this.shopCode = shopCode;
    }
    public String getShopCode()
    {
        return shopCode;
    }
    public void setPlantCode(String plantCode)
    {
        this.plantCode = plantCode;
    }
    public String getPlantCode()
    {
        return plantCode;
    }
    public void setStatus(String status)
    {
        this.status = status;
    }
    public String getStatus()
    {
        return status;
    }
    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("shopName", getShopName())
            .append("shopCode", getShopCode())
            .append("plantCode", getPlantCode())
            .append("status", getStatus())
            .append("createBy", getCreateBy())
            .append("createTime", getCreateTime())
            .append("updateBy", getUpdateBy())
            .append("updateTime", getUpdateTime())
            .toString();
    }
}
aps-modules/aps-core/src/main/java/com/aps/core/mapper/ApsPlantMapper.java
@@ -19,7 +19,7 @@
     * @param id å·¥åŽ‚ç®¡ç†ä¸»é”®
     * @return å·¥åŽ‚ç®¡ç†
     */
    public ApsPlant selectApsPlantById(Long id);
    public ApsPlant selectApsPlantById(String id);
    /**
     * æŸ¥è¯¢å·¥åŽ‚ç®¡ç†åˆ—è¡¨
@@ -51,7 +51,7 @@
     * @param id å·¥åŽ‚ç®¡ç†ä¸»é”®
     * @return ç»“æžœ
     */
    public int deleteApsPlantById(Long id);
    public int deleteApsPlantById(String id);
    /**
     * æ‰¹é‡åˆ é™¤å·¥åŽ‚ç®¡ç†
@@ -59,5 +59,5 @@
     * @param ids éœ€è¦åˆ é™¤çš„æ•°æ®ä¸»é”®é›†åˆ
     * @return ç»“æžœ
     */
    public int deleteApsPlantByIds(Long[] ids);
    public int deleteApsPlantByIds(String[] ids);
}
aps-modules/aps-core/src/main/java/com/aps/core/mapper/ApsShopMapper.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,63 @@
package com.aps.core.mapper;
import java.util.List;
import com.aps.core.domain.ApsShop;
import org.apache.ibatis.annotations.Mapper;
/**
 * è½¦é—´Mapper接口
 *
 * @author ruoyi
 * @date 2025-04-14
 */
@Mapper
public interface ApsShopMapper
{
    /**
     * æŸ¥è¯¢è½¦é—´
     *
     * @param id è½¦é—´ä¸»é”®
     * @return è½¦é—´
     */
    public ApsShop selectApsShopById(String id);
    /**
     * æŸ¥è¯¢è½¦é—´åˆ—表
     *
     * @param apsShop è½¦é—´
     * @return è½¦é—´é›†åˆ
     */
    public List<ApsShop> selectApsShopList(ApsShop apsShop);
    /**
     * æ–°å¢žè½¦é—´
     *
     * @param apsShop è½¦é—´
     * @return ç»“æžœ
     */
    public int insertApsShop(ApsShop apsShop);
    /**
     * ä¿®æ”¹è½¦é—´
     *
     * @param apsShop è½¦é—´
     * @return ç»“æžœ
     */
    public int updateApsShop(ApsShop apsShop);
    /**
     * åˆ é™¤è½¦é—´
     *
     * @param id è½¦é—´ä¸»é”®
     * @return ç»“æžœ
     */
    public int deleteApsShopById(String id);
    /**
     * æ‰¹é‡åˆ é™¤è½¦é—´
     *
     * @param ids éœ€è¦åˆ é™¤çš„æ•°æ®ä¸»é”®é›†åˆ
     * @return ç»“æžœ
     */
    public int deleteApsShopByIds(String[] ids);
}
aps-modules/aps-core/src/main/java/com/aps/core/service/IApsPlantService.java
@@ -17,7 +17,7 @@
     * @param id å·¥åŽ‚ç®¡ç†ä¸»é”®
     * @return å·¥åŽ‚ç®¡ç†
     */
    public ApsPlant selectApsPlantById(Long id);
    public ApsPlant selectApsPlantById(String id);
    /**
     * æŸ¥è¯¢å·¥åŽ‚ç®¡ç†åˆ—è¡¨
@@ -49,7 +49,7 @@
     * @param ids éœ€è¦åˆ é™¤çš„工厂管理主键集合
     * @return ç»“æžœ
     */
    public int deleteApsPlantByIds(Long[] ids);
    public int deleteApsPlantByIds(String[] ids);
    /**
     * åˆ é™¤å·¥åŽ‚ç®¡ç†ä¿¡æ¯
@@ -57,5 +57,5 @@
     * @param id å·¥åŽ‚ç®¡ç†ä¸»é”®
     * @return ç»“æžœ
     */
    public int deleteApsPlantById(Long id);
    public int deleteApsPlantById(String id);
}
aps-modules/aps-core/src/main/java/com/aps/core/service/IApsShopService.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,61 @@
package com.aps.core.service;
import java.util.List;
import com.aps.core.domain.ApsShop;
/**
 * è½¦é—´Service接口
 *
 * @author ruoyi
 * @date 2025-04-14
 */
public interface IApsShopService
{
    /**
     * æŸ¥è¯¢è½¦é—´
     *
     * @param id è½¦é—´ä¸»é”®
     * @return è½¦é—´
     */
    public ApsShop selectApsShopById(String id);
    /**
     * æŸ¥è¯¢è½¦é—´åˆ—表
     *
     * @param apsShop è½¦é—´
     * @return è½¦é—´é›†åˆ
     */
    public List<ApsShop> selectApsShopList(ApsShop apsShop);
    /**
     * æ–°å¢žè½¦é—´
     *
     * @param apsShop è½¦é—´
     * @return ç»“æžœ
     */
    public int insertApsShop(ApsShop apsShop);
    /**
     * ä¿®æ”¹è½¦é—´
     *
     * @param apsShop è½¦é—´
     * @return ç»“æžœ
     */
    public int updateApsShop(ApsShop apsShop);
    /**
     * æ‰¹é‡åˆ é™¤è½¦é—´
     *
     * @param ids éœ€è¦åˆ é™¤çš„车间主键集合
     * @return ç»“æžœ
     */
    public int deleteApsShopByIds(String[] ids);
    /**
     * åˆ é™¤è½¦é—´ä¿¡æ¯
     *
     * @param id è½¦é—´ä¸»é”®
     * @return ç»“æžœ
     */
    public int deleteApsShopById(String id);
}
aps-modules/aps-core/src/main/java/com/aps/core/service/impl/ApsPlantServiceImpl.java
@@ -2,6 +2,8 @@
import java.util.List;
import com.aps.common.core.utils.DateUtils;
import com.aps.common.core.utils.uuid.IdUtils;
import com.aps.common.security.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.aps.core.mapper.ApsPlantMapper;
@@ -27,7 +29,7 @@
     * @return å·¥åŽ‚ç®¡ç†
     */
    @Override
    public ApsPlant selectApsPlantById(Long id)
    public ApsPlant selectApsPlantById(String id)
    {
        return apsPlantMapper.selectApsPlantById(id);
    }
@@ -53,7 +55,9 @@
    @Override
    public int insertApsPlant(ApsPlant apsPlant)
    {
        apsPlant.setId(IdUtils.fastSimpleUUID());
        apsPlant.setCreateTime(DateUtils.getNowDate());
        apsPlant.setCreateBy(SecurityUtils.getUsername());
        return apsPlantMapper.insertApsPlant(apsPlant);
    }
@@ -77,7 +81,7 @@
     * @return ç»“æžœ
     */
    @Override
    public int deleteApsPlantByIds(Long[] ids)
    public int deleteApsPlantByIds(String[] ids)
    {
        return apsPlantMapper.deleteApsPlantByIds(ids);
    }
@@ -89,7 +93,7 @@
     * @return ç»“æžœ
     */
    @Override
    public int deleteApsPlantById(Long id)
    public int deleteApsPlantById(String id)
    {
        return apsPlantMapper.deleteApsPlantById(id);
    }
aps-modules/aps-core/src/main/java/com/aps/core/service/impl/ApsShopServiceImpl.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,100 @@
package com.aps.core.service.impl;
import java.util.List;
import com.aps.common.core.utils.DateUtils;
import com.aps.common.core.utils.uuid.IdUtils;
import com.aps.common.security.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.aps.core.mapper.ApsShopMapper;
import com.aps.core.domain.ApsShop;
import com.aps.core.service.IApsShopService;
/**
 * è½¦é—´Service业务层处理
 *
 * @author ruoyi
 * @date 2025-04-14
 */
@Service
public class ApsShopServiceImpl implements IApsShopService
{
    @Autowired
    private ApsShopMapper apsShopMapper;
    /**
     * æŸ¥è¯¢è½¦é—´
     *
     * @param id è½¦é—´ä¸»é”®
     * @return è½¦é—´
     */
    @Override
    public ApsShop selectApsShopById(String id)
    {
        return apsShopMapper.selectApsShopById(id);
    }
    /**
     * æŸ¥è¯¢è½¦é—´åˆ—表
     *
     * @param apsShop è½¦é—´
     * @return è½¦é—´
     */
    @Override
    public List<ApsShop> selectApsShopList(ApsShop apsShop)
    {
        return apsShopMapper.selectApsShopList(apsShop);
    }
    /**
     * æ–°å¢žè½¦é—´
     *
     * @param apsShop è½¦é—´
     * @return ç»“æžœ
     */
    @Override
    public int insertApsShop(ApsShop apsShop)
    {
        apsShop.setId(IdUtils.fastSimpleUUID());
        apsShop.setCreateBy(SecurityUtils.getUsername());
        apsShop.setCreateTime(DateUtils.getNowDate());
        return apsShopMapper.insertApsShop(apsShop);
    }
    /**
     * ä¿®æ”¹è½¦é—´
     *
     * @param apsShop è½¦é—´
     * @return ç»“æžœ
     */
    @Override
    public int updateApsShop(ApsShop apsShop)
    {
        apsShop.setUpdateTime(DateUtils.getNowDate());
        return apsShopMapper.updateApsShop(apsShop);
    }
    /**
     * æ‰¹é‡åˆ é™¤è½¦é—´
     *
     * @param ids éœ€è¦åˆ é™¤çš„车间主键
     * @return ç»“æžœ
     */
    @Override
    public int deleteApsShopByIds(String[] ids)
    {
        return apsShopMapper.deleteApsShopByIds(ids);
    }
    /**
     * åˆ é™¤è½¦é—´ä¿¡æ¯
     *
     * @param id è½¦é—´ä¸»é”®
     * @return ç»“æžœ
     */
    @Override
    public int deleteApsShopById(String id)
    {
        return apsShopMapper.deleteApsShopById(id);
    }
}
aps-modules/aps-core/src/main/resources/mapper/core/ApsPlantMapper.xml
@@ -28,7 +28,7 @@
        </where>
    </select>
    
    <select id="selectApsPlantById" parameterType="Long" resultMap="ApsPlantResult">
    <select id="selectApsPlantById" parameterType="String" resultMap="ApsPlantResult">
        <include refid="selectApsPlantVo"/>
        where id = #{id}
    </select>
@@ -36,6 +36,7 @@
    <insert id="insertApsPlant" parameterType="ApsPlant" useGeneratedKeys="true" keyProperty="id">
        insert into aps_plant
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null  and id != ''" >id,</if>
            <if test="plantName != null">plant_name,</if>
            <if test="plantCode != null">plant_code,</if>
            <if test="status != null">status,</if>
@@ -45,6 +46,7 @@
            <if test="updateTime != null">update_time,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="id != null">#{id},</if>
            <if test="plantName != null">#{plantName},</if>
            <if test="plantCode != null">#{plantCode},</if>
            <if test="status != null">#{status},</if>
@@ -69,7 +71,7 @@
        where id = #{id}
    </update>
    <delete id="deleteApsPlantById" parameterType="Long">
    <delete id="deleteApsPlantById" parameterType="String">
        delete from aps_plant where id = #{id}
    </delete>
aps-modules/aps-core/src/main/resources/mapper/core/ApsShopMapper.xml
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,89 @@
<?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.aps.core.mapper.ApsShopMapper">
    <resultMap type="ApsShop" id="ApsShopResult">
        <result property="id"    column="id"    />
        <result property="shopName"    column="shop_name"    />
        <result property="shopCode"    column="shop_code"    />
        <result property="plantCode"    column="plant_code"    />
        <result property="status"    column="status"    />
        <result property="createBy"    column="create_by"    />
        <result property="createTime"    column="create_time"    />
        <result property="updateBy"    column="update_by"    />
        <result property="updateTime"    column="update_time"    />
    </resultMap>
    <sql id="selectApsShopVo">
        select id, shop_name, shop_code, plant_code, status, create_by, create_time, update_by, update_time from aps_shop
    </sql>
    <select id="selectApsShopList" parameterType="ApsShop" resultMap="ApsShopResult">
        <include refid="selectApsShopVo"/>
        <where>
            <if test="shopName != null  and shopName != ''"> and shop_name like concat('%', #{shopName}, '%')</if>
            <if test="shopCode != null  and shopCode != ''"> and shop_code like concat('%', #{shopCode}, '%')</if>
            <if test="plantCode != null  and plantCode != ''"> and plant_code = #{plantCode}</if>
            <if test="status != null  and status != ''"> and status = #{status}</if>
        </where>
    </select>
    <select id="selectApsShopById" parameterType="String" resultMap="ApsShopResult">
        <include refid="selectApsShopVo"/>
        where id = #{id}
    </select>
    <insert id="insertApsShop" parameterType="ApsShop">
        insert into aps_shop
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">id,</if>
            <if test="shopName != null">shop_name,</if>
            <if test="shopCode != null">shop_code,</if>
            <if test="plantCode != null">plant_code,</if>
            <if test="status != null">status,</if>
            <if test="createBy != null">create_by,</if>
            <if test="createTime != null">create_time,</if>
            <if test="updateBy != null">update_by,</if>
            <if test="updateTime != null">update_time,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="id != null">#{id},</if>
            <if test="shopName != null">#{shopName},</if>
            <if test="shopCode != null">#{shopCode},</if>
            <if test="plantCode != null">#{plantCode},</if>
            <if test="status != null">#{status},</if>
            <if test="createBy != null">#{createBy},</if>
            <if test="createTime != null">#{createTime},</if>
            <if test="updateBy != null">#{updateBy},</if>
            <if test="updateTime != null">#{updateTime},</if>
         </trim>
    </insert>
    <update id="updateApsShop" parameterType="ApsShop">
        update aps_shop
        <trim prefix="SET" suffixOverrides=",">
            <if test="shopName != null">shop_name = #{shopName},</if>
            <if test="shopCode != null">shop_code = #{shopCode},</if>
            <if test="plantCode != null">plant_code = #{plantCode},</if>
            <if test="status != null">status = #{status},</if>
            <if test="createBy != null">create_by = #{createBy},</if>
            <if test="createTime != null">create_time = #{createTime},</if>
            <if test="updateBy != null">update_by = #{updateBy},</if>
            <if test="updateTime != null">update_time = #{updateTime},</if>
        </trim>
        where id = #{id}
    </update>
    <delete id="deleteApsShopById" parameterType="String">
        delete from aps_shop where id = #{id}
    </delete>
    <delete id="deleteApsShopByIds" parameterType="String">
        delete from aps_shop where id in
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </delete>
</mapper>