diff --git a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/vo/MaLabelBindVO.java b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/vo/MaLabelBindVO.java index aae5ad3b..88bdeeed 100644 --- a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/vo/MaLabelBindVO.java +++ b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/vo/MaLabelBindVO.java @@ -74,4 +74,7 @@ public class MaLabelBindVO { @ApiModelProperty(value = "中间表主键") private String id; + + @ApiModelProperty(value = "关键字") + private String keyWord; } diff --git a/sgzb-modules/sgzb-base/src/main/resources/mapper/base/MaLabelBindMapper.xml b/sgzb-modules/sgzb-base/src/main/resources/mapper/base/MaLabelBindMapper.xml index 1f6f16aa..1b4cc0ad 100644 --- a/sgzb-modules/sgzb-base/src/main/resources/mapper/base/MaLabelBindMapper.xml +++ b/sgzb-modules/sgzb-base/src/main/resources/mapper/base/MaLabelBindMapper.xml @@ -38,25 +38,36 @@ mt4.type_name as kindName ,a.status,a.binder,dic.name,ma.ma_code,user.user_name FROM ma_machine_label b left join ma_label_bind a on a.ma_id = b.ma_id - LEFT JOIN ma_type mt ON a.type_id = mt.type_id + LEFT JOIN ma_type mt ON a.type_id = mt.type_id LEFT JOIN ma_type mt2 ON mt2.type_id = mt.parent_id AND mt2.`level` = '3' LEFT JOIN ma_type mt3 ON mt2.parent_id = mt3.type_id AND mt3.`level` = '2' LEFT JOIN ma_type mt4 ON mt3.parent_id = mt4.type_id AND mt4.`level` = '1' LEFT JOIN ma_type_repair mtk ON mtk.type_id = mt.type_id LEFT JOIN sys_dic dic ON dic.id = b.label_type - LEFT JOIN ma_machine ma ON ma.ma_id = a.ma_id + LEFT JOIN ma_machine ma ON ma.ma_id = a.ma_id LEFT JOIN sys_user user on user.user_id =a.binder - - and a.label_code = #{labelCode} - and a.type_id = #{typeId} - and a.bind_time = #{bindTime} - and a.binder = #{binder} - and a.label_type = #{labelType} - and a.company_id = #{companyId} - and mt2.type_id= #{modelId} - and mt3.type_name = #{wpName} - and b.is_bind = #{isBind} - + where 1=1 + + and (b.label_code like concat('%',#{keyWord},'%') or + mt2.type_name like concat('%',#{keyWord},'%') or + mt.type_name like concat('%',#{keyWord},'%') or + ma.ma_code like concat('%',#{keyWord},'%') + ) + + + and mt2.type_id = #{typeId} + + + and mt.type_id= #{modelId} + + + and a.label_code = #{labelCode} + and a.bind_time = #{bindTime} + and a.binder = #{binder} + and a.company_id = #{companyId} + + and mt3.type_name = #{wpName} + and b.is_bind = #{isBind} ORDER BY b.is_bind ASC,a.bind_time DESC,b.create_time DESC