42 lines
1.5 KiB
Java
42 lines
1.5 KiB
Java
package com.gunshi.project.xyt.mapper;
|
|
|
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.gunshi.file.model.FileDescriptor;
|
|
import com.gunshi.project.xyt.entity.so.RescueGoodsPageSo;
|
|
import com.gunshi.project.xyt.model.RescueGoodsB;
|
|
import org.apache.ibatis.annotations.Mapper;
|
|
import org.apache.ibatis.annotations.Param;
|
|
import org.apache.ibatis.annotations.Select;
|
|
|
|
import java.util.List;
|
|
|
|
@Mapper
|
|
public interface RescueGoodsMapper extends BaseMapper<RescueGoodsB> {
|
|
|
|
|
|
@Select("""
|
|
<script>
|
|
select t.*
|
|
from public.rescue_goods_b t
|
|
<where>
|
|
<if test="obj.goodsName != null and obj.goodsName !=''">
|
|
t.goods_name LIKE concat('%',#{obj.goodsName},'%')
|
|
</if>
|
|
</where>
|
|
<if test="obj.sortField != null and obj.sortField !=''">
|
|
order by t.${obj.sortField} asc
|
|
</if>
|
|
</script>
|
|
""")
|
|
Page<RescueGoodsB> pageQuery(@Param("page") Page<RescueGoodsB> page,@Param("obj") RescueGoodsPageSo RescueGoodsPageSo);
|
|
|
|
@Select("""
|
|
<script>
|
|
select * from public.file_descriptor
|
|
where file_id in (select file_id from public.rescue_goods_file where goods_id = #{goodsId})
|
|
</script>
|
|
""")
|
|
List<FileDescriptor> detail(@Param("goodsId") Long goodsId);
|
|
|
|
} |