lanan-system/dl-module-repair/src/main/resources/mapper/project/RepairOrderInfoMapper.xml

56 lines
2.5 KiB
XML
Raw Normal View History

2024-09-23 15:24:09 +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.project.mapper.RepairOrderInfoMapper">
<!--
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
文档可见https://www.iocoder.cn/MyBatis/x-plugins/
-->
<select id="queryListPage" resultType="cn.iocoder.yudao.module.project.vo.RepairOrderInfoRespVO">
SELECT
roi.*
FROM
repair_order_info roi
<where>
roi.deleted = 0
<if test="entity.orderNo != null and entity.orderNo != ''">
and roi.order_no like concat('%', #{entity.orderNo}, '%')
</if>
<if test="entity.goodsTitle != null and entity.goodsTitle != ''">
and roi.goods_totle like concat('%', #{entity.goodsTitle}, '%')
</if>
<if test="entity.goodsType != null and entity.goodsType != ''">
and roi.goods_type = #{entity.goodsType}
</if>
<if test="entity.cusName != null and entity.cusName != ''">
and roi.cus_name like concat('%', #{entity.cusName}, '%')
</if>
<if test="entity.orderStatus != null and entity.orderStatus != ''">
and roi.order_status = #{entity.orderStatus}
</if>
</where>
</select>
2024-09-23 18:21:48 +08:00
<select id="getOrderPageByStatus" resultType="cn.iocoder.yudao.module.project.vo.RepairOrderInfoRespVO">
select roi.*,drt.tickets_work_status as status from repair_order_info roi left join dl_repair_tickets drt on
roi.goods_id = drt.id
where roi.deleted = '0'
<if test="map.userId != null and map.userId != ''">
and roi.user_id = #{map.userId}
</if>
<if test="map.status != null and map.status != ''">
<choose>
<when test="map.status != '00'">
drt.tickets_work_status = #{map.status}
</when>
<when test="map.status == '00'">
roi.comment_time is null
</when>
</choose>
</if>
order by roi.create_time desc
</select>
2024-09-23 15:24:09 +08:00
</mapper>