| 
									
										
										
										
											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.DlRepairSoMapper"> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     <resultMap id="BaseResultMap" type="cn.iocoder.yudao.module.stockOperate.entity.DlRepairSo"> | 
					
						
							|  |  |  |             <id property="id" column="id" jdbcType="VARCHAR"/> | 
					
						
							|  |  |  |             <result property="soType" column="so_type" jdbcType="VARCHAR"/> | 
					
						
							|  |  |  |             <result property="purchaseType" column="purchase_type" jdbcType="VARCHAR"/> | 
					
						
							|  |  |  |             <result property="soNo" column="so_no" jdbcType="VARCHAR"/> | 
					
						
							|  |  |  |             <result property="supplierId" column="supplier_id" jdbcType="VARCHAR"/> | 
					
						
							|  |  |  |             <result property="supplierName" column="supplier_name" jdbcType="VARCHAR"/> | 
					
						
							|  |  |  |             <result property="userId" column="user_id" jdbcType="BIGINT"/> | 
					
						
							|  |  |  |             <result property="userName" column="user_name" jdbcType="VARCHAR"/> | 
					
						
							|  |  |  |             <result property="soTime" column="so_time" jdbcType="TIMESTAMP"/> | 
					
						
							|  |  |  |             <result property="itemCount" column="item_count" jdbcType="INTEGER"/> | 
					
						
							|  |  |  |             <result property="totalPrice" column="total_price" jdbcType="DECIMAL"/> | 
					
						
							|  |  |  |             <result property="soStatus" column="so_status" jdbcType="VARCHAR"/> | 
					
						
							|  |  |  |             <result property="remark" column="remark" jdbcType="VARCHAR"/> | 
					
						
							|  |  |  |             <result property="corpId" column="corp_id" jdbcType="VARCHAR"/> | 
					
						
							|  |  |  |             <result property="corpName" column="corp_name" jdbcType="VARCHAR"/> | 
					
						
							|  |  |  |             <result property="deptId" column="dept_id" jdbcType="BIGINT"/> | 
					
						
							| 
									
										
										
										
											2024-09-18 15:04:54 +08:00
										 |  |  |             <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/> | 
					
						
							|  |  |  |             <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/> | 
					
						
							|  |  |  |             <result property="updater" column="updater" jdbcType="VARCHAR"/> | 
					
						
							| 
									
										
										
										
											2024-10-21 21:37:22 +08:00
										 |  |  |             <result property="twId" column="tw_id" /> | 
					
						
							| 
									
										
										
										
											2024-09-13 18:25:51 +08:00
										 |  |  |     </resultMap> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     <sql id="Base_SQL"> | 
					
						
							|  |  |  |         select id, | 
					
						
							|  |  |  |                so_type, | 
					
						
							|  |  |  |                purchase_type, | 
					
						
							|  |  |  |                so_no, | 
					
						
							|  |  |  |                supplier_id, | 
					
						
							|  |  |  |                supplier_name, | 
					
						
							|  |  |  |                user_id, | 
					
						
							|  |  |  |                user_name, | 
					
						
							|  |  |  |                so_time, | 
					
						
							|  |  |  |                item_count, | 
					
						
							|  |  |  |                total_price, | 
					
						
							|  |  |  |                so_status, | 
					
						
							|  |  |  |                remark, | 
					
						
							|  |  |  |                corp_id, | 
					
						
							|  |  |  |                corp_name, | 
					
						
							| 
									
										
										
										
											2024-09-18 15:04:54 +08:00
										 |  |  |                dept_id, | 
					
						
							|  |  |  |                create_time, | 
					
						
							|  |  |  |                update_time, | 
					
						
							| 
									
										
										
										
											2024-10-21 21:37:22 +08:00
										 |  |  |                updater, | 
					
						
							|  |  |  |                tw_id | 
					
						
							| 
									
										
										
										
											2024-09-13 18:25:51 +08:00
										 |  |  |         from dl_repair_so so | 
					
						
							|  |  |  |         where so.deleted = '0' | 
					
						
							|  |  |  |     </sql> | 
					
						
							| 
									
										
										
										
											2024-09-14 18:27:29 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  |     <select id="getRepairSoPage" resultMap="BaseResultMap"> | 
					
						
							|  |  |  |         <include refid="Base_SQL"/> | 
					
						
							| 
									
										
										
										
											2024-09-22 21:38:41 +08:00
										 |  |  |         <if test="map.soType != null and map.soType"> | 
					
						
							|  |  |  |             and so_type = #{map.soType} | 
					
						
							|  |  |  |         </if> | 
					
						
							|  |  |  |         <if test="map.purchaseType != null and map.purchaseType != ''"> | 
					
						
							|  |  |  |             and purchase_type = #{map.purchaseType} | 
					
						
							|  |  |  |         </if> | 
					
						
							| 
									
										
										
										
											2024-09-18 15:04:54 +08:00
										 |  |  |         <if test="map.soStatus != null and map.soStatus != ''"> | 
					
						
							|  |  |  |             and so.so_status = #{map.soStatus} | 
					
						
							|  |  |  |         </if> | 
					
						
							| 
									
										
										
										
											2024-09-22 21:38:41 +08:00
										 |  |  |         <if test="map.soStatus == null"> | 
					
						
							|  |  |  |             and so.so_status != '06' | 
					
						
							|  |  |  |         </if> | 
					
						
							| 
									
										
										
										
											2024-09-18 15:04:54 +08:00
										 |  |  |         <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.supplierId != null and map.supplierId != ''"> | 
					
						
							|  |  |  |             and so.supplier_id = #{map.supplierId} | 
					
						
							|  |  |  |         </if> | 
					
						
							|  |  |  |         <if test="map.corpId != null and map.corpId != ''"> | 
					
						
							|  |  |  |             and so.corp_id = #{map.corpId} | 
					
						
							|  |  |  |         </if> | 
					
						
							|  |  |  |         <if test="map.soNo != null and map.soNo != ''"> | 
					
						
							|  |  |  |             and (so.so_no like concat('%', #{map.soNo}, '%') or so.remark like concat('%', #{map.soNo}, '%')) | 
					
						
							|  |  |  |         </if> | 
					
						
							| 
									
										
										
										
											2024-09-22 21:38:41 +08:00
										 |  |  |         <if test="map.userId != null and map.userId != ''"> | 
					
						
							|  |  |  |             and (so.user_id = #{map.userId}) | 
					
						
							|  |  |  |         </if> | 
					
						
							| 
									
										
										
										
											2024-09-18 15:04:54 +08:00
										 |  |  |         order by so.create_time desc | 
					
						
							| 
									
										
										
										
											2024-09-14 18:27:29 +08:00
										 |  |  |     </select> | 
					
						
							| 
									
										
										
										
											2024-10-22 16:37:05 +08:00
										 |  |  |     <select id="selectCountNum" resultType="java.lang.Integer"> | 
					
						
							|  |  |  |         SELECT | 
					
						
							|  |  |  |             COUNT(id) | 
					
						
							|  |  |  |         FROM | 
					
						
							|  |  |  |             dl_repair_so | 
					
						
							|  |  |  |         WHERE | 
					
						
							|  |  |  |             user_id = #{userId} | 
					
						
							|  |  |  |           AND so_type = #{type} | 
					
						
							|  |  |  |           AND so_status = #{status} | 
					
						
							|  |  |  |           AND deleted = 0 | 
					
						
							|  |  |  |     </select> | 
					
						
							| 
									
										
										
										
											2024-09-13 18:25:51 +08:00
										 |  |  | </mapper> |