| | |
| | | <result column="id" property="id"/> |
| | | <result column="work_order_name" property="workOrderName"/> |
| | | <result column="work_order_code" property="workOrderCode"/> |
| | | <result column="work_order_type" property="workOrderType"/> |
| | | <result column="work_order_type" property="workOrderType" typeHandler="org.sxkj.common.handler.GenericListTypeHandler"/> |
| | | <result column="device_load_demand" property="deviceLoadDemand"/> |
| | | <result column="recommend_device_ids" property="recommendDeviceIds"/> |
| | | <result column="work_order_status" property="workOrderStatus"/> |
| | |
| | | <result column="is_deleted" property="isDeleted"/> |
| | | </resultMap> |
| | | |
| | | <select id="getWorkOrderDetail" resultType="org.sxkj.gd.workorder.entity.GdWorkOrderEntity"> |
| | | <select id="getWorkOrderDetail" resultMap="gdWorkOrderResultMap"> |
| | | select id, |
| | | work_order_name, |
| | | work_order_code, |
| | |
| | | and wo.work_order_name like concat('%',#{param2.workOrderName},'%') |
| | | </if> |
| | | <if test="param2.workOrderType != null and param2.workOrderType != ''"> |
| | | and wo.work_order_type::VARCHAR = #{param2.workOrderType}::VARCHAR |
| | | /* 将逗号分隔的字符串转换为带引号的格式,如 "road,road1" 转为 "\"road\",\"road1\"" */ |
| | | and wo.work_order_type like concat('%', |
| | | ( |
| | | select string_agg(concat('"', trim(arr_val), '"'), ',') |
| | | from unnest(string_to_array(#{param2.workOrderType}, ',')) as arr_val |
| | | ), |
| | | '%') |
| | | </if> |
| | | <if test="param2.createUser != null "> |
| | | /* 修改点2:过滤条件也进行类型对齐 */ |
| | | and wo.create_user::VARCHAR = #{param2.createUser}::VARCHAR |
| | | </if> |
| | | <if test="param2.startTime != null and param2.startTime != '' and param2.endTime != null and param2.endTime != ''"> |
| | | and wo.create_time BETWEEN #{param2.startTime}::timestamp AND #{param2.endTime}::timestamp |
| | | and wo.execute_start_time <= #{param2.endTime}::timestamp AND wo.execute_end_time >= #{param2.startTime}::timestamp |
| | | </if> |
| | | <if test="param2.deptList != null and param2.deptList.size > 0"> |
| | | /* 修改点3:IN 查询内部元素类型转换 */ |