lanan-system/dl-module-repair/src/main/resources/mapper/stockOperate/DlRepairSoiMapper.xml

73 lines
2.9 KiB
XML
Raw Normal View History

2024-09-13 18:25:51 +08:00
<?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="cn.iocoder.yudao.module.stockOperate.mapper.DlRepairSoiMapper">
<resultMap id="BaseResultMap" type="cn.iocoder.yudao.module.stockOperate.entity.DlRepairSoi">
<id property="id" column="id" jdbcType="VARCHAR"/>
<result property="soId" column="so_id" jdbcType="VARCHAR"/>
2024-09-18 15:04:54 +08:00
<result property="soiType" column="soi_type" jdbcType="VARCHAR"/>
2024-09-13 18:25:51 +08:00
<result property="goodsId" column="goods_id" jdbcType="VARCHAR"/>
<result property="goodsType" column="goods_type" jdbcType="VARCHAR"/>
<result property="wareId" column="ware_id" jdbcType="VARCHAR"/>
<result property="goodsCount" column="goods_count" jdbcType="INTEGER"/>
<result property="goodsPrice" column="goods_price" jdbcType="DECIMAL"/>
<result property="remark" column="remark" jdbcType="VARCHAR"/>
</resultMap>
<sql id="Base_SQL">
2024-09-18 15:04:54 +08:00
select soi.id,
2024-09-13 18:25:51 +08:00
so_id,
2024-09-18 15:04:54 +08:00
soi_type,
2024-09-13 18:25:51 +08:00
goods_id,
goods_type,
ware_id,
goods_count,
goods_price,
2024-09-18 15:04:54 +08:00
soi.remark,
so.create_time,
so.so_status,
so.corp_id
2024-09-13 18:25:51 +08:00
from dl_repair_soi soi
2024-09-18 15:04:54 +08:00
left join
dl_repair_so so
on soi.so_id = so.id
2024-09-22 21:38:41 +08:00
left join dl_repair_wares drw on soi.goods_id = drw.id
where soi.deleted = '0' and so.so_status != '06'
2024-09-13 18:25:51 +08:00
</sql>
2024-09-18 15:04:54 +08:00
<select id="getRepairSoiPage" resultMap="BaseResultMap">
<include refid="Base_SQL" />
<if test="map.goodsType != null and map.goodsType != ''">
and soi.goods_type = #{map.goodsType}
</if>
<if test="map.soiType != null and map.soiType != ''">
and soi.soi_type = #{map.soiType}
</if>
<if test="map.searchTimeArray != null and map.searchTimeArray.length > 0">
and (so.create_time between #{map.searchTimeArray[0]} and #{map.searchTimeArray[1]})
</if>
<if test="map.soStatus != null and map.soStatus != ''">
and so.so_status = #{map.soStatus}
</if>
<if test="map.corpId != null and map.corpId != ''">
and so.corp_id = #{map.corpId}
</if>
2024-09-22 21:38:41 +08:00
<if test="map.wareId != null and map.wareId != ''">
and soi.ware_id = #{map.wareId}
</if>
<if test="map.query != null and map.query != null">
and (
so.so_no like concat('%', #{map.query}, '%')
or
drw.name like concat('%', #{map.query}, '%')
or
drw.code like concat('%', #{map.query}, '%')
or
drw.model like concat('%', #{map.query}, '%')
)
</if>
2024-09-18 15:04:54 +08:00
</select>
2024-09-13 18:25:51 +08:00
</mapper>