xuhy
4 天以前 b95f5fb1af8a80ac03a8da8da3e863ad468bf477
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<?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.TErpMaintenanceReminderMapper">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.ruoyi.system.model.TErpMaintenanceReminder">
        <id column="id" property="id" />
        <result column="clinic_supplier_id" property="clinicSupplierId" />
        <result column="maintenance_type" property="maintenanceType" />
        <result column="warehousing_id" property="warehousingId" />
        <result column="status" property="status" />
        <result column="maintenance_person_id" property="maintenancePersonId" />
        <result column="maintenance_time" property="maintenanceTime" />
        <result column="maintenance_record" property="maintenanceRecord" />
        <result column="create_time" property="createTime" />
        <result column="update_time" property="updateTime" />
        <result column="create_by" property="createBy" />
        <result column="update_by" property="updateBy" />
        <result column="disabled" property="disabled" />
    </resultMap>
 
    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        id, clinic_supplier_id, maintenance_type, warehousing_id, status, maintenance_person_id, maintenance_time, maintenance_record, create_time, update_time, create_by, update_by, disabled
    </sql>
    <select id="pageList" resultType="com.ruoyi.system.vo.TErpMaintenanceReminderListVo">
        select t1.id,
               t4.goods_name,
               t4.type_id,
               t2.batch_number,
               t1.maintenance_person_id,
               t1.maintenance_time,
               t1.`status`,
               t3.warehouse_no
        from t_erp_maintenance_reminder t1
                 LEFT JOIN t_erp_supplier_warehousing_batch t2 on t1.warehousing_batch_id = t2.id
                 left join t_erp_supplier_warehousing t3 on t2.warehousing_id = t3.id
                 left join t_erp_goods t4 on t3.goods_id = t4.id
        where t1.disabled = 0
          <if test="user.roleType !=null and user.roleType==4">
              and t1.clinic_supplier_id = #{user.supplierClinicId} and t1.maintenance_type=1
          </if>
          <if test="user.roleType !=null and user.roleType==5">
              and t1.clinic_supplier_id = #{user.supplierClinicId} and t1.maintenance_type=2
          </if>
         <if test="query.warehouseNo != null and query.warehouseNo != ''">
            and t3.warehouse_no =#{query.warehouseNo}
        </if>
        <if test="query.goodsName != null and query.goodsName != ''">
            and t4.goods_name like concat('%',#{query.goodsName},'%')
        </if>
        <if test="query.typeId != null and query.typeId != '' ">
            and t4.type_id = #{query.typeId}
        </if>
        <if test="query.batchNumber != null and query.batchNumber != ''">
            and t2.batch_number = #{query.batchNumber}
        </if>
        <if test="query.status != null ">
            and t1.`status` = #{query.status}
        </if>
    </select>
 
</mapper>