| | |
| | | <result column="is_deleted" property="isDeleted"/> |
| | | </resultMap> |
| | | <select id="pageQuery" resultType="org.springblade.mdm.basesetting.machine.vo.MachineVO"> |
| | | select m.id,m.name,m.code,g.dict_key machine_group_code,g.dict_value machine_group_name,m.machine_spec,m.manufacturer,m.operator,m.status |
| | | from mdm_machine m join blade_dict_biz g on m.machine_group_code=g.dict_key and g.code='machine_group' and g.is_deleted=0 |
| | | select m.id,m.name,m.code,m.equipment_code,g.dict_key machine_group_code,g.dict_value machine_group_name,m.machine_spec,msp.dict_value machine_spec_name |
| | | ,d.dept_name owner_dept_name,s.dict_value control_system_name,m.manufacturer,m.operator,m.status |
| | | ,prog_send_dir,prog_receive_dir,prog_temp_dir,m.remark,send_dir_expiry_hours,receive_dir_expiry_hours |
| | | from mdm_machine m |
| | | left join blade_dict_biz g on m.machine_group_code=g.dict_key and g.code='machine_group' and g.is_deleted=0 |
| | | left join blade_dict_biz msp on m.machine_spec=msp.dict_key and msp.code='machine_spec' and msp.is_deleted=0 |
| | | left join blade_dict_biz s on m.control_system=s.dict_key and s.code='machine_control_system' and s.is_deleted=0 |
| | | left join blade_dept d on m.owner_dept=d.id |
| | | where m.is_deleted=0 |
| | | <if test="query.machineGroupCode!=null and query.machineGroupCode!=''"> |
| | | and m.machineGroupCode=#{query.keyword,jdbcType=VARCHAR} |
| | | and m.machine_group_code=#{query.machineGroupCode,jdbcType=VARCHAR} |
| | | </if> |
| | | <if test="query.keyword!=null and query.keyword!=''"> |
| | | and (m.code like CONCAT('%', #{query.keyword,jdbcType=VARCHAR},'%') or m.name like CONCAT('%', #{query.keyword,jdbcType=VARCHAR},'%')) |
| | | </if> |
| | | <if test="query.deptId!=null"> |
| | | and (m.owner_dept=${query.deptId} or m.owner_dept in (select id from blade_dept where ancestors like CONCAT(#{query.deptAncestors},'%'))) |
| | | </if> |
| | | order by m.update_time desc,m.code asc |
| | | </select> |
| | | |
| | | |
| | | <!-- <select id="parentTree" resultMap="treeNodeResultMap">--> |
| | | <!-- select id, parent_id, dict_value as title, id as "value", id as "key" from blade_dict where is_deleted = 0 and parent_id = 0--> |
| | | <!-- </select>--> |
| | | |
| | | </mapper> |