Commit 55a72df9 by 王力

Merge branch 'dev_bugfix_orderrequests' into 'develop'

修改

See merge request !136
2 parents 27b4290e 72b73e57
......@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import java.util.List;
......@@ -17,9 +18,19 @@ public interface EngineerInfoMPDao extends BaseMapper<EngineerInfo> {
@Select("select * from engineer_info where engineer_code = #{engineerCode}")
List<EngineerInfo> selectByEngineerCode(String engineerCode);
@Select({"select * from engineer_info where engineer_code in <foreach item='engineerCode' index='index' collection='engineerCodes' open='(' separator=',' close=')'>#{engineerCode}</foreach>"})
@SelectProvider(type=SqlProvider.class, method = "selectByOrderIds")
List<EngineerInfo> selectByEngineerCodes(@Param("engineerCodes") List<String> engineerCodes);
@Select("select * from engineer_info where group_id = #{groupId}")
List<EngineerInfo> selectByGroupId(String groupId);
}
class SqlProvider {
public String selectByOrderIds(@Param("orderIds") List<String> orderIds) {
StringBuilder sb = new StringBuilder();
sb.append("SELECT * FROM order_request WHERE order_id IN ");
sb.append("<foreach item='orderId' collection='orderIds' open='(' separator=',' close=')'>#{orderId}</foreach>");
return sb.toString();
}
}
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!